Skip to content

Instantly share code, notes, and snippets.

@avandecreme
Created February 10, 2023 15:02
Show Gist options
  • Save avandecreme/c68ec04615dbc9faaaf70c6d27599a14 to your computer and use it in GitHub Desktop.
Save avandecreme/c68ec04615dbc9faaaf70c6d27599a14 to your computer and use it in GitHub Desktop.
{
"components": {
"schemas": {
"Foo": {
"oneOf": [
{
"properties": {
"contents": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"tag": {
"enum": [
"Bar"
],
"type": "string"
}
},
"required": [
"tag",
"contents"
],
"type": "object"
},
{
"properties": {
"tag": {
"enum": [
"Baz"
],
"type": "string"
}
},
"required": [
"tag"
],
"type": "object"
}
]
}
}
},
"info": {
"title": "",
"version": ""
},
"openapi": "3.0.0",
"paths": {
"/bar": {
"get": {
"responses": {
"200": {
"content": {
"application/json;charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Foo"
}
}
},
"description": ""
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment