Advertisement
Gamania

OpenApi.Net & Swagger test

Jun 10th, 2021
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.41 KB | None | 0 0
  1. {
  2.   "swagger": "2.0",
  3.   "info": {
  4.     "title": "Swagger Petstore",
  5.     "license": {
  6.       "name": "MIT"
  7.     },
  8.     "version": "1.0.0"
  9.   },
  10.   "host": "petstore.swagger.io",
  11.   "basePath": "/v1",
  12.   "schemes": [
  13.     "http"
  14.   ],
  15.   "paths": {
  16.     "/pets": {
  17.       "get": {
  18.         "tags": [
  19.           "pets"
  20.         ],
  21.         "summary": "List all pets",
  22.         "operationId": "listPets",
  23.         "produces": [
  24.           "application/json"
  25.         ],
  26.         "parameters": [
  27.           {
  28.             "in": "query",
  29.             "name": "limit",
  30.             "description": "How many items to return at one time (max 100)",
  31.             "type": "integer",
  32.             "format": "int32"
  33.           }
  34.         ],
  35.         "responses": {
  36.           "200": {
  37.             "description": "A paged array of pets",
  38.             "schema": {
  39.               "$ref": "#/definitions/Pets"
  40.             },
  41.             "headers": {
  42.               "x-next": {
  43.                 "description": "A link to the next page of responses",
  44.                 "type": "string"
  45.               }
  46.             }
  47.           },
  48.           "default": {
  49.             "description": "unexpected error",
  50.             "schema": {
  51.               "$ref": "#/definitions/Error"
  52.             }
  53.           }
  54.         }
  55.       },
  56.       "post": {
  57.         "tags": [
  58.           "pets"
  59.         ],
  60.         "summary": "Create a pet",
  61.         "operationId": "createPets",
  62.         "produces": [
  63.           "application/json"
  64.         ],
  65.         "responses": {
  66.           "201": {
  67.             "description": "Null response"
  68.           },
  69.           "default": {
  70.             "description": "unexpected error",
  71.             "schema": {
  72.               "$ref": "#/definitions/Error"
  73.             }
  74.           }
  75.         }
  76.       }
  77.     },
  78.     "/pets/{petId}": {
  79.       "get": {
  80.         "tags": [
  81.           "pets"
  82.         ],
  83.         "summary": "Info for a specific pet",
  84.         "operationId": "showPetById",
  85.         "produces": [
  86.           "application/json"
  87.         ],
  88.         "parameters": [
  89.           {
  90.             "in": "path",
  91.             "name": "petId",
  92.             "description": "The id of the pet to retrieve",
  93.             "required": true,
  94.             "type": "string"
  95.           }
  96.         ],
  97.         "responses": {
  98.           "200": {
  99.             "description": "Expected response to a valid request",
  100.             "schema": {
  101.               "$ref": "#/definitions/Pet"
  102.             }
  103.           },
  104.           "default": {
  105.             "description": "unexpected error",
  106.             "schema": {
  107.               "$ref": "#/definitions/Error"
  108.             }
  109.           }
  110.         }
  111.       }
  112.     }
  113.   },
  114.   "definitions": {
  115.     "Pet": {
  116.       "required": [
  117.         "id",
  118.         "name"
  119.       ],
  120.       "type": "object",
  121.       "properties": {
  122.         "id": {
  123.           "format": "int64",
  124.           "type": "integer"
  125.         },
  126.         "name": {
  127.           "type": "string"
  128.         },
  129.         "tag": {
  130.           "type": "string"
  131.         }
  132.       }
  133.     },
  134.     "Pets": {
  135.       "type": "array",
  136.       "items": {
  137.         "$ref": "#/definitions/Pet"
  138.       }
  139.     },
  140.     "Error": {
  141.       "required": [
  142.         "code",
  143.         "message"
  144.       ],
  145.       "type": "object",
  146.       "properties": {
  147.         "code": {
  148.           "format": "int32",
  149.           "type": "integer"
  150.         },
  151.         "message": {
  152.           "type": "string"
  153.         }
  154.       }
  155.     }
  156.   }
  157. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement