Created
April 13, 2023 07:02
-
-
Save cogwirrel/6f6355e04b831bfbbbe57337b3429b9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.2", | |
"info": { | |
"title": "MyApi", | |
"version": "1.0", | |
"description": "A sample api" | |
}, | |
"paths": { | |
"/example": { | |
"get": { | |
"operationId": "ExampleOperation", | |
"responses": { | |
"200": { | |
"description": "ExampleOperation 200 response", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ExampleOperationResponseContent" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"Bar": { | |
"type": "object", | |
"properties": { | |
"barArg": { | |
"type": "string" | |
} | |
} | |
}, | |
"ExampleOperationResponseContent": { | |
"type": "object", | |
"properties": { | |
"fooOrBar": { | |
"$ref": "#/components/schemas/FooOrBar" | |
} | |
} | |
}, | |
"Foo": { | |
"type": "object", | |
"properties": { | |
"fooArg": { | |
"type": "string" | |
} | |
} | |
}, | |
"FooOrBar": { | |
"oneOf": [ | |
{ | |
"type": "object", | |
"title": "foo", | |
"properties": { | |
"foo": { | |
"$ref": "#/components/schemas/Foo" | |
} | |
}, | |
"required": [ | |
"foo" | |
] | |
}, | |
{ | |
"type": "object", | |
"title": "bar", | |
"properties": { | |
"bar": { | |
"$ref": "#/components/schemas/Bar" | |
} | |
}, | |
"required": [ | |
"bar" | |
] | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment