We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Example Swagger/OpenAPI definition:
{ "openapi": "3.1.1", "info": { "title": "Playground | v1", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:5150" } ], "paths": { "/todos": { "post": { "tags": [ "TodoEndpoints" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TodoRequest" } } }, "required": true }, "responses": { "201": { "description": "Created" } } } } }, "components": { "schemas": { "NullableOfPriority": { "enum": [ "Low", "Medium", "High", "Critical", null ] }, "TodoRequest": { "required": [ "description", "priority" ], "type": "object", "properties": { "description": { "type": [ "null", "string" ] }, "dueDate": { "type": [ "null", "string" ], "format": "date-time" }, "priority": { "$ref": "#/components/schemas/NullableOfPriority" }, "tags": { "type": [ "null", "array" ], "items": { "type": "string" } } } } } }, "tags": [ { "name": "TodoEndpoints" } ] }
Swagger UI produces nulls for Description and DueDate properties in the Example Value section:
null
Description
DueDate
Steps to reproduce the behavior:
The following for the example value:
In the specification above, if we change the order of members in the type array from:
"description": { "type": [ "null", "string" ] },
To:
"description": { "type": [ "string", "null" ] },
Swagger UI will produce the correct example value.
The text was updated successfully, but these errors were encountered:
fix: fix nullable primitive types defined as list of types (swagger-a…
67e3adf
…pi#10388)
2b33f83
Addressed in #10390.
Sorry, something went wrong.
Released as https://github.com/swagger-api/swagger-ui/releases/tag/v5.20.4
Successfully merging a pull request may close this issue.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
Swagger UI produces
null
s forDescription
andDueDate
properties in the Example Value section:To reproduce...
Steps to reproduce the behavior:
Expected behavior
The following for the example value:
Additional context or thoughts
In the specification above, if we change the order of members in the type array from:
To:
Swagger UI will produce the correct example value.
The text was updated successfully, but these errors were encountered: