-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Open
Description
Q&A (please complete the following information)
- OS: [e.g. macOS] mac OS
- Browser: [e.g. chrome, safari] chrome
- Version: unsure
- Method of installation: unsure
- Swagger-UI version: unsure
- Swagger/OpenAPI version: unsure
Content & configuration
Example Swagger/OpenAPI definition:
{
"openapi": "3.1.0",
"info": {
"title": "OpenAPI definition",
"version": "v0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
}
],
"paths": {
"/hello": {
"get": {
"tags": [
"my-controller"
],
"operationId": "hello",
"parameters": [
{
"name": "request",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/RequestWrapper"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Wrapper"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"MyEnum": {
"type": "string",
"enum": [
"FOO",
"BAR"
]
},
"RequestWrapper": {
"type": "object",
"properties": {
"enumValue": {
"$ref": "#/components/schemas/MyEnum"
}
}
},
"Wrapper": {
"type": "object",
"properties": {
"enumValue": {
"$ref": "#/components/schemas/MyEnum"
}
}
}
}
}
}I am testing using only https://swagger.io/tools/swagger-editor/ but I have encountered this locally as well.
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
- Go to https://editor.swagger.io/
- Paste in the YAML above
- Notice that the enum is exploded in all types that have the enum as a field
- Change OAS version to 3.0.0 and the enum is no longer exploded everywhere but is rather referred to.
Expected behavior
I expected 3.1.0 to behave as well as 3.0.0 in terms of enums.
Screenshots
With 3.1.0
With 3.0.0
Additional context or thoughts
Metadata
Metadata
Assignees
Labels
No labels