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

Array with enum values in items: nested description not displayed #942

Open
AnnikaStrupp-initAG opened this issue Sep 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AnnikaStrupp-initAG
Copy link

AnnikaStrupp-initAG commented Sep 3, 2024

Describe the bug

The generated documentation does not display a 'description' text provided on the level of 'enum' in array 'items'.

Expected behavior

The 'description' is rendered and displayed on screen. This would be particularly useful for $ref referenced codelists in 'items' that come with their own description.

Current behavior

The generated documentation does not display a 'description' text provided on the level of 'enum' in array 'items'. The specified set of 'enum' values is correctly displayed as 'Possible values'.

Steps to reproduce

example-array .yaml

  example:
    type: array
    items:
      enum:
        - 1
        - 2
        - 3
        - string
      description: >
        This description is sadly not rendered.
example

Version used:

  • node.js 20.12.1
  • Docusaurus 3.4.0
  • Docusaurus OpenAPI Docs 3.0.1
  • Windows desktop
@AnnikaStrupp-initAG AnnikaStrupp-initAG added the bug Something isn't working label Sep 3, 2024
@sserrata
Copy link
Member

sserrata commented Sep 5, 2024

Hi @AnnikaStrupp-initAG, thanks for opening this issue. Can you explain why it wouldn't make sense to define description at the same level as type? Also, can you help me find where in the official OpenAPI documentation this feature is defined/described? Thanks!

@aldafu
Copy link

aldafu commented Sep 13, 2024

why it wouldn't make sense to define description at the same level as type?

It makes sense and is really useful when you want define the items of the array in a OpenAPI ReferenceObject that you then can reference in multiple places without repeating yourself. And then obviously have the description property as part of that same ReferenceObject to describe the enum in detail.

Let me also add that rapidoc and openapi-explorer handle this case as expected, i.e. the description property is rendered and displayed.

can you help me find where in the official OpenAPI documentation this feature is defined/described? Thanks!

Sure thing, go here https://swagger.io/specification/v3/#schema-object and have a look at the second part under the "Properties" section where you will find type and description properties equally, i.e. same level.

Ohne Titel 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants