|
1 | 1 | {
|
2 |
| - "openapi": "3.0.0", |
3 |
| - "info": { |
4 |
| - "title": "Cat Fact API", |
5 |
| - "description": "An API for facts about cats", |
6 |
| - "contact": { |
7 |
| - "email": "contact@catfact.ninja" |
8 |
| - }, |
9 |
| - "version": "1.0.0" |
| 2 | + "openapi": "3.0.0", |
| 3 | + "info": { |
| 4 | + "title": "Cat Fact API", |
| 5 | + "description": "An API for facts about cats", |
| 6 | + "contact": { |
| 7 | + "email": "contact@catfact.ninja" |
10 | 8 | },
|
11 |
| - "servers": [ |
12 |
| - { |
13 |
| - "url": "https://catfact.ninja" |
14 |
| - } |
15 |
| - ], |
16 |
| - "paths": { |
17 |
| - "/fact": { |
18 |
| - "get": { |
19 |
| - "tags": [ |
20 |
| - "Facts" |
21 |
| - ], |
22 |
| - "summary": "Get Random Fact", |
23 |
| - "description": "Returns a random fact", |
24 |
| - "operationId": "getRandomFact", |
25 |
| - "parameters": [ |
26 |
| - { |
27 |
| - "name": "max_length", |
28 |
| - "in": "query", |
29 |
| - "description": "maximum length of returned fact", |
30 |
| - "required": false, |
31 |
| - "schema": { |
32 |
| - "type": "integer", |
33 |
| - "format": "int64" |
34 |
| - } |
35 |
| - } |
36 |
| - ], |
37 |
| - "responses": { |
38 |
| - "200": { |
39 |
| - "description": "successful operation", |
40 |
| - "content": { |
41 |
| - "application/json": { |
42 |
| - "schema": { |
43 |
| - "$ref": "#/components/schemas/CatFact" |
44 |
| - } |
45 |
| - } |
46 |
| - } |
47 |
| - }, |
48 |
| - "404": { |
49 |
| - "description": "Fact not found" |
50 |
| - } |
51 |
| - } |
| 9 | + "version": "1.0.0" |
| 10 | + }, |
| 11 | + "servers": [ |
| 12 | + { |
| 13 | + "url": "https://catfact.ninja" |
| 14 | + } |
| 15 | + ], |
| 16 | + "paths": { |
| 17 | + "/fact": { |
| 18 | + "get": { |
| 19 | + "tags": ["Facts"], |
| 20 | + "summary": "Get Random Cat Fact", |
| 21 | + "description": "Returns a random fact about cats", |
| 22 | + "operationId": "getRandomFact", |
| 23 | + "parameters": [ |
| 24 | + { |
| 25 | + "name": "max_length", |
| 26 | + "in": "query", |
| 27 | + "description": "maximum length of returned fact", |
| 28 | + "required": false, |
| 29 | + "schema": { |
| 30 | + "type": "integer", |
| 31 | + "format": "int64" |
52 | 32 | }
|
53 |
| - } |
54 |
| - }, |
55 |
| - "components": { |
56 |
| - "schemas": { |
57 |
| - "CatFact": { |
58 |
| - "title": "CatFact model", |
59 |
| - "description": "CatFact", |
60 |
| - "properties": { |
61 |
| - "fact": { |
62 |
| - "title": "Fact", |
63 |
| - "description": "Fact", |
64 |
| - "type": "string", |
65 |
| - "format": "string" |
66 |
| - }, |
67 |
| - "length": { |
68 |
| - "title": "Length", |
69 |
| - "description": "Length", |
70 |
| - "type": "integer", |
71 |
| - "format": "int32" |
72 |
| - } |
73 |
| - }, |
74 |
| - "type": "object" |
| 33 | + } |
| 34 | + ], |
| 35 | + "responses": { |
| 36 | + "200": { |
| 37 | + "description": "successful operation", |
| 38 | + "content": { |
| 39 | + "application/json": { |
| 40 | + "schema": { |
| 41 | + "$ref": "#/components/schemas/CatFact" |
| 42 | + } |
| 43 | + } |
75 | 44 | }
|
| 45 | + }, |
| 46 | + "404": { |
| 47 | + "description": "Fact not found" |
| 48 | + } |
76 | 49 | }
|
77 |
| - }, |
78 |
| - "tags": [ |
79 |
| - { |
80 |
| - "name": "Facts", |
81 |
| - "description": "Cat Facts" |
82 |
| - } |
83 |
| - ], |
84 |
| - "security": [ |
85 |
| - [] |
86 |
| - ] |
| 50 | + } |
| 51 | + } |
| 52 | + }, |
| 53 | + "components": { |
| 54 | + "schemas": { |
| 55 | + "CatFact": { |
| 56 | + "title": "CatFact model", |
| 57 | + "description": "CatFact", |
| 58 | + "properties": { |
| 59 | + "fact": { |
| 60 | + "title": "Fact", |
| 61 | + "description": "Fact", |
| 62 | + "type": "string", |
| 63 | + "format": "string" |
| 64 | + }, |
| 65 | + "length": { |
| 66 | + "title": "Length", |
| 67 | + "description": "Length", |
| 68 | + "type": "integer", |
| 69 | + "format": "int32" |
| 70 | + } |
| 71 | + }, |
| 72 | + "type": "object" |
| 73 | + } |
| 74 | + } |
| 75 | + }, |
| 76 | + "tags": [ |
| 77 | + { |
| 78 | + "name": "Facts", |
| 79 | + "description": "Cat Facts" |
| 80 | + } |
| 81 | + ], |
| 82 | + "security": [[]] |
87 | 83 | }
|
0 commit comments