Created
December 15, 2019 19:58
-
-
Save danzel/b78c6e8daa1ef96470fac030d92e26ae 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" | |
} | |
} | |
}, | |
"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", | |
"nullable": true | |
}, | |
"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