Created
December 15, 2019 19:47
-
-
Save danzel/407b2caee59d79bcadb8a044277650e0 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.1", | |
"info": { | |
"title": "My API", | |
"version": "v1" | |
}, | |
"paths": { | |
"/Test/Get": { | |
"get": { | |
"tags": [ | |
"Test" | |
], | |
"operationId": "GetIt", | |
"responses": { | |
"200": { | |
"description": "Success", | |
"content": { | |
"text/plain": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"text/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/Test/PostRequired": { | |
"post": { | |
"tags": [ | |
"Test" | |
], | |
"operationId": "PostRequired", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"text/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"application/*+json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Success" | |
} | |
} | |
} | |
}, | |
"/Test/PostNonRequired": { | |
"post": { | |
"tags": [ | |
"Test" | |
], | |
"operationId": "PostNotRequired", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"text/json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
}, | |
"application/*+json": { | |
"schema": { | |
"$ref": "#/components/schemas/MyType" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"200": { | |
"description": "Success" | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"MyInnerType": { | |
"type": "object", | |
"properties": { | |
"ignoreMe": { | |
"type": "integer", | |
"format": "int32" | |
} | |
}, | |
"nullable": true | |
}, | |
"MyType": { | |
"required": [ | |
"requiredInner", | |
"requiredInteger", | |
"requiredString" | |
], | |
"type": "object", | |
"properties": { | |
"requiredString": { | |
"type": "string" | |
}, | |
"nonRequiredString": { | |
"type": "string", | |
"nullable": true | |
}, | |
"requiredInteger": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"nonRequiredInteger": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"requiredInner": { | |
"$ref": "#/components/schemas/MyInnerType" | |
}, | |
"nonRequiredInner": { | |
"$ref": "#/components/schemas/MyInnerType" | |
} | |
}, | |
"nullable": true | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment