Debian Codegraph @

fixtures/json/resources/resourceWithExamplePayload.json

raw
1 {
2 "swagger": "2.0",
3 "info": {
4 "version": "1.0.9-abcd",
5 "title": "Swagger Sample API",
6 "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
7 "termsOfService": "http://helloreverb.com/terms/",
8 "contact": {
9 "name": "wordnik api team",
10 "url": "http://developer.wordnik.com"
11 },
12 "license": {
13 "name": "Creative Commons 4.0 International",
14 "url": "http://creativecommons.org/licenses/by/4.0/"
15 }
16 },
17 "host": "my.api.com",
18 "basePath": "/v1",
19 "schemes": [
20 "http",
21 "https"
22 ],
23 "consumes": [
24 "application/json"
25 ],
26 "produces": [
27 "application/json",
28 "application/xml"
29 ],
30 "paths": {
31 "/pets/{petId}": {
32 "get": {
33 "description": "Returns a pet based on ID",
34 "summary": "Find pet by ID",
35 "operationId": "getPetsById",
36 "produces": [
37 "application/json",
38 "text/html"
39 ],
40 "parameters": [
41 {
42 "name": "petId",
43 "in": "path",
44 "description": "ID of pet that needs to be fetched",
45 "required": true,
46 "type": "array",
47 "items": {
48 "type": "string"
49 },
50 "collectionFormat": "csv"
51 }
52 ],
53 "responses": {
54 "200": {
55 "description": "pet response",
56 "schema": {
57 "$ref": "Pet"
58 },
59 "examples": {
60 "application/json": {
61 "id": 9,
62 "category": {
63 "name": "domestic"
64 },
65 "name": "monster",
66 "tags": [
67 {
68 "name": "for sale"
69 }
70 ],
71 "status": "alive"
72 }
73 }
74 },
75 "default": {
76 "description": "error payload",
77 "schema": {
78 "$ref": "ErrorModel"
79 }
80 }
81 }
82 }
83 }
84 },
85 "definitions": {
86 "Pet": {
87 "required": [
88 "name"
89 ],
90 "properties": {
91 "name": {
92 "type": "string",
93 "example": "cat"
94 },
95 "tag": {
96 "type": "string",
97 "example": "for sale"
98 }
99 }
100 },
101 "ErrorModel": {
102 "required": [ "code", "message" ],
103 "properties": {
104 "code": {
105 "type": "integer",
106 "format": "int32"
107 },
108 "message": {
109 "type": "string"
110 }
111 }
112 }
113 }
114 }