Skip to content

Instantly share code, notes, and snippets.

@benktesh
Created December 13, 2018 16:42
Show Gist options
  • Select an option

  • Save benktesh/de9c9a961224e9057d7022ba82708d5b to your computer and use it in GitHub Desktop.

Select an option

Save benktesh/de9c9a961224e9057d7022ba82708d5b to your computer and use it in GitHub Desktop.

Revisions

  1. benktesh revised this gist Dec 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion swagger_response_json.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```json
    ```javascript
    {
    "swagger": "2.0",
    "info": {
  2. benktesh created this gist Dec 13, 2018.
    306 changes: 306 additions & 0 deletions swagger_response_json.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,306 @@
    ```json
    {
    "swagger": "2.0",
    "info": {
    "version": "v1",
    "title": "SmartStock API"
    },
    "paths": {
    "/api/Stock": {
    "get": {
    "tags": [
    "Stock"
    ],
    "operationId": "GetStock",
    "consumes": [],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "uniqueItems": false,
    "type": "array",
    "items": {
    "$ref": "#/definitions/Stock"
    }
    }
    }
    }
    },
    "post": {
    "tags": [
    "Stock"
    ],
    "operationId": "PostStock",
    "consumes": [
    "application/json-patch+json",
    "application/json",
    "text/json",
    "application/*+json"
    ],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [
    {
    "name": "stock",
    "in": "body",
    "required": false,
    "schema": {
    "$ref": "#/definitions/Stock"
    }
    }
    ],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "$ref": "#/definitions/Stock"
    }
    }
    }
    }
    },
    "/api/Stock/{symbol}": {
    "get": {
    "tags": [
    "Stock"
    ],
    "operationId": "GetStock",
    "consumes": [],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [
    {
    "name": "symbol",
    "in": "path",
    "required": true,
    "type": "string"
    }
    ],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "uniqueItems": false,
    "type": "array",
    "items": {
    "$ref": "#/definitions/Stock"
    }
    }
    }
    }
    }
    },
    "/api/Stock/{id}": {
    "delete": {
    "tags": [
    "Stock"
    ],
    "operationId": "DeleteStock",
    "consumes": [],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "string",
    "format": "uuid"
    }
    ],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "type": "boolean"
    }
    }
    }
    }
    },
    "/api/Values": {
    "get": {
    "tags": [
    "Values"
    ],
    "operationId": "Get",
    "consumes": [],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "uniqueItems": false,
    "type": "array",
    "items": {
    "type": "string"
    }
    }
    }
    },
    "deprecated": true
    },
    "post": {
    "tags": [
    "Values"
    ],
    "operationId": "Post",
    "consumes": [
    "application/json-patch+json",
    "application/json",
    "text/json",
    "application/*+json"
    ],
    "produces": [],
    "parameters": [
    {
    "name": "value",
    "in": "body",
    "required": false,
    "schema": {
    "type": "string"
    }
    }
    ],
    "responses": {
    "200": {
    "description": "Success"
    }
    },
    "deprecated": true
    }
    },
    "/api/Values/{id}": {
    "get": {
    "tags": [
    "Values"
    ],
    "operationId": "Get",
    "consumes": [],
    "produces": [
    "text/plain",
    "application/json",
    "text/json"
    ],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "integer",
    "format": "int32"
    }
    ],
    "responses": {
    "200": {
    "description": "Success",
    "schema": {
    "type": "string"
    }
    }
    },
    "deprecated": true
    },
    "put": {
    "tags": [
    "Values"
    ],
    "operationId": "Put",
    "consumes": [
    "application/json-patch+json",
    "application/json",
    "text/json",
    "application/*+json"
    ],
    "produces": [],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "integer",
    "format": "int32"
    },
    {
    "name": "value",
    "in": "body",
    "required": false,
    "schema": {
    "type": "string"
    }
    }
    ],
    "responses": {
    "200": {
    "description": "Success"
    }
    },
    "deprecated": true
    },
    "delete": {
    "tags": [
    "Values"
    ],
    "operationId": "Delete",
    "consumes": [],
    "produces": [],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "integer",
    "format": "int32"
    }
    ],
    "responses": {
    "200": {
    "description": "Success"
    }
    },
    "deprecated": true
    }
    }
    },
    "definitions": {
    "Stock": {
    "type": "object",
    "properties": {
    "id": {
    "format": "uuid",
    "type": "string"
    },
    "ticker": {
    "type": "string"
    },
    "company": {
    "type": "string"
    },
    "price": {
    "format": "double",
    "type": "number"
    }
    }
    }
    }
    }