Skip to content

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

Open
@knthls

Description

@knthls

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions