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

when enum has null, swagger ui doesn't show "null" #9682

Closed
bejewel-kyoungmin opened this issue Mar 12, 2024 · 0 comments · Fixed by #9683
Closed

when enum has null, swagger ui doesn't show "null" #9682

bejewel-kyoungmin opened this issue Mar 12, 2024 · 0 comments · Fixed by #9683

Comments

@bejewel-kyoungmin
Copy link
Contributor

bejewel-kyoungmin commented Mar 12, 2024

Q&A (please complete the following information)

  • OS: [macOS]
  • Browser: [chrome]
  • Version: [122]
  • Method of installation: [npm]
  • Swagger-UI version: [5.1.10]
  • Swagger/OpenAPI version: [OpenAPI 3.0]

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.0
info:
  title: Sample API
  description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
  version: 0.1.9
servers:
  - url: http://api.example.com/v1
    description: Optional server description, e.g. Main (production) server
  - url: http://staging-api.example.com
    description: Optional server description, e.g. Internal staging server for testing
paths:
  /users:
    get:
      summary: Returns a list of users.
      description: Optional extended description in CommonMark or HTML.
      parameters:
        - in: query
          name: sort
          description: Sort order
          schema:
            type: string
            nullable: true
            enum:
              - asc
              - desc
              - null 
      responses:
        '200':
          description: A JSON array of user names
          content:
            application/json:
              schema: 
                type: string
                nullable: true
                enum:
                  - asc
                  - desc
                  - null 

Swagger-UI configuration options:

SwaggerUI({
  // no custom option
})

Describe the bug you're encountering

Both Parameters and Responses section,
when there are enum type variables and the enum variables have null value, null value is not shown.

To reproduce...

use above yaml

Expected behavior

null value should be shown

Screenshots

스크린샷 2024-03-12 오후 12 44 04

Additional context or thoughts

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

Successfully merging a pull request may close this issue.

1 participant