You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openapi: 3.1.0info:
title: Never type render issue demoversion: 0.0.0components:
schemas:
base_type:
type: objectadditionalProperties: falseproperties:
foo:
type: stringbar:
type: numberbaz:
type: booleanpaths:
/test:
get:
responses:
'200':
description: This is a testcontent:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/base_type'
- properties:
bar: false
Swagger-UI configuration options:
SwaggerUI({url: "./openapi.json"})
Describe the bug you're encountering
When using never typed objects in the JSON schema, they are correctly displayed as never in the schema preview box, but get rendered as "string" in the automatically generated sample inputs.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
When using
never
typed objects in the JSON schema, they are correctly displayed asnever
in the schema preview box, but get rendered as"string"
in the automatically generated sample inputs.To reproduce...
Steps to reproduce the behavior:
/test
endpoint under thedefault
tagExample Value
andSchema
to see the difference in expected types.Expected behavior
Fields with the
never
type should be omitted from the example value generatorScreenshots
Additional context or thoughts
Not sure if this is a problem with Swagger-UI directly or the library that is being used to generate the previews internally.
The text was updated successfully, but these errors were encountered: