Skip to content

Instantly share code, notes, and snippets.

@effervescentia
Last active April 4, 2023 18:43
Show Gist options
  • Save effervescentia/543446af14c4a1dbf1c208f32cf7802c to your computer and use it in GitHub Desktop.
Save effervescentia/543446af14c4a1dbf1c208f32cf7802c to your computer and use it in GitHub Desktop.
OpenAPI Schema with enum union
{
"openapi": "3.0.0",
"paths": {
"/test": {
"get": {
"operationId": "TestController_badUnion",
"responses": {
"200": {
"description": "success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"value": {
"oneOf": [
{
"type": "string",
"enum": [
"foo"
]
},
{
"type": "string",
"enum": [
"bar"
]
},
{
"type": "string",
"enum": [
"fizz"
]
}
]
}
},
"required": [
"value"
]
}
}
}
}
},
"tags": [
"Test"
]
}
}
},
"info": {
"title": "Test",
"version": "1.0.0",
"contact": {}
},
"tags": [],
"servers": [],
"components": {
"schemas": {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment