Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showExtension option on array of strings does not show extensions #2559

Open
knthls opened this issue Jul 15, 2024 · 0 comments · May be fixed by #2560
Open

showExtension option on array of strings does not show extensions #2559

knthls opened this issue Jul 15, 2024 · 0 comments · May be fixed by #2560

Comments

@knthls
Copy link

knthls commented Jul 15, 2024

Describe the bug
In an openapi spec, using the x-extensible-enum extension and the showAnnotations option, the extension is not rendered, when the type is an array of enum

Expected behavior
I expect the extensions to be shown, similar to what happens when an array of enum is rendered.

Minimal reproducible OpenAPI snippet(if possible)
Consider the following spec:

openapi: 3.1.0
info:
  title: Minimal Museum API
  version: 1.0.0
servers:
  - url: 'https://api.fake-museum-example.com/v1'
paths:
  /museum-hours:
    get:
      summary: Get museum hours
      operationId: getMuseumHours
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  hours:
                    type: array
                    items:
                      type: string
                      x-extensible-enum:
                        - OPEN
                        - CLOSED
                  hours2:
                    type: array
                    items:
                      type: string
                      enum:
                        - OPEN
                        - CLOSED

Screenshots

Bildschirmfoto 2024-07-15 um 16 22 08

Additional context

I know that x-extensible-enum is not supported directly, however I found that with the showExtensions option enabled, it works well enough for our use case. I do have a fix in mind, however I don't know if this would have any unwanted side effects that I can't think of. I will open a draft PR containing my fix and I would be happy if you would consider my change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant