|
1 | 1 | { |
2 | 2 | "openapi": "3.0.1", |
3 | 3 | "info": { |
4 | | - "title": "Dog Facts API", |
| 4 | + "title": "Dog Breeds API", |
5 | 5 | "version": "1.0.0", |
6 | | - "description": "An API for facts about dogs", |
7 | | - "contact": { |
8 | | - |
9 | | - } |
| 6 | + "description": "An API for information about dog breeds" |
10 | 7 | }, |
11 | 8 | "servers": [ |
12 | 9 | { |
13 | | - "url": "https://dogapi.dog/api/v2" |
| 10 | + "url": "https://api.thedogapi.com/v1" |
14 | 11 | } |
15 | 12 | ], |
16 | 13 | "paths": { |
17 | | - "/facts": { |
| 14 | + "/breeds": { |
18 | 15 | "get": { |
19 | | - "summary": "Get Dog Facts", |
20 | | - "description": "Returns facts about dogs", |
21 | | - "operationId": "getDogFacts", |
22 | | - "tags": ["Facts"], |
| 16 | + "summary": "Get Dog Breeds", |
| 17 | + "description": "Returns information about dog breeds", |
| 18 | + "operationId": "getDogBreeds", |
| 19 | + "tags": ["Breeds"], |
23 | 20 | "parameters": [ |
24 | 21 | { |
25 | 22 | "name": "limit", |
26 | 23 | "in": "query", |
27 | | - "description": "Maximum number of facts to return", |
| 24 | + "description": "Maximum number of breeds to return", |
28 | 25 | "required": false, |
29 | 26 | "schema": { |
30 | 27 | "type": "integer" |
|
37 | 34 | "content": { |
38 | 35 | "application/json": { |
39 | 36 | "schema": { |
40 | | - "$ref": "#/components/schemas/DogFactsResponse" |
| 37 | + "type": "array", |
| 38 | + "items": { |
| 39 | + "$ref": "#/components/schemas/DogBreed" |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + }, |
| 48 | + "/breeds/search": { |
| 49 | + "get": { |
| 50 | + "summary": "Search Dog Breeds", |
| 51 | + "description": "Search for dog breeds by name", |
| 52 | + "operationId": "searchDogBreeds", |
| 53 | + "tags": ["Breeds"], |
| 54 | + "parameters": [ |
| 55 | + { |
| 56 | + "name": "q", |
| 57 | + "in": "query", |
| 58 | + "description": "Search query for breed name", |
| 59 | + "required": true, |
| 60 | + "schema": { |
| 61 | + "type": "string" |
| 62 | + } |
| 63 | + } |
| 64 | + ], |
| 65 | + "responses": { |
| 66 | + "200": { |
| 67 | + "description": "successful operation", |
| 68 | + "content": { |
| 69 | + "application/json": { |
| 70 | + "schema": { |
| 71 | + "type": "array", |
| 72 | + "items": { |
| 73 | + "$ref": "#/components/schemas/DogBreed" |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + }, |
| 82 | + "/breeds/{breedId}": { |
| 83 | + "get": { |
| 84 | + "summary": "Get Dog Breed Details", |
| 85 | + "description": "Get detailed information about a specific dog breed", |
| 86 | + "operationId": "getDogBreedDetails", |
| 87 | + "tags": ["Breeds"], |
| 88 | + "parameters": [ |
| 89 | + { |
| 90 | + "name": "breedId", |
| 91 | + "in": "path", |
| 92 | + "description": "ID of the breed to retrieve", |
| 93 | + "required": true, |
| 94 | + "schema": { |
| 95 | + "type": "integer" |
| 96 | + } |
| 97 | + } |
| 98 | + ], |
| 99 | + "responses": { |
| 100 | + "200": { |
| 101 | + "description": "successful operation", |
| 102 | + "content": { |
| 103 | + "application/json": { |
| 104 | + "schema": { |
| 105 | + "$ref": "#/components/schemas/DogBreed" |
41 | 106 | } |
42 | 107 | } |
43 | 108 | } |
44 | | - }, |
45 | | - "404": { |
46 | | - "description": "Facts not found" |
47 | 109 | } |
48 | 110 | } |
49 | 111 | } |
50 | 112 | } |
51 | 113 | }, |
52 | 114 | "components": { |
| 115 | + "securitySchemes": { |
| 116 | + "ApiKeyAuth": { |
| 117 | + "type": "apiKey", |
| 118 | + "in": "header", |
| 119 | + "name": "x-api-key" |
| 120 | + } |
| 121 | + }, |
53 | 122 | "schemas": { |
54 | | - "DogFactsResponse": { |
55 | | - "title": "DogFactsResponse model", |
56 | | - "description": "Response containing dog facts", |
| 123 | + "DogBreed": { |
| 124 | + "title": "DogBreed model", |
| 125 | + "description": "Information about a dog breed", |
57 | 126 | "properties": { |
58 | | - "data": { |
59 | | - "type": "array", |
60 | | - "items": { |
61 | | - "$ref": "#/components/schemas/DogFact" |
62 | | - } |
| 127 | + "id": { |
| 128 | + "type": "integer", |
| 129 | + "description": "Unique identifier for the breed" |
| 130 | + }, |
| 131 | + "name": { |
| 132 | + "type": "string", |
| 133 | + "description": "Name of the breed" |
| 134 | + }, |
| 135 | + "bred_for": { |
| 136 | + "type": "string", |
| 137 | + "description": "What the breed was bred for" |
| 138 | + }, |
| 139 | + "breed_group": { |
| 140 | + "type": "string", |
| 141 | + "description": "The breed group" |
| 142 | + }, |
| 143 | + "life_span": { |
| 144 | + "type": "string", |
| 145 | + "description": "Life span of the breed" |
| 146 | + }, |
| 147 | + "temperament": { |
| 148 | + "type": "string", |
| 149 | + "description": "Temperament characteristics" |
| 150 | + }, |
| 151 | + "origin": { |
| 152 | + "type": "string", |
| 153 | + "description": "Origin country/region" |
| 154 | + }, |
| 155 | + "reference_image_id": { |
| 156 | + "type": "string", |
| 157 | + "description": "Reference image ID" |
| 158 | + }, |
| 159 | + "weight": { |
| 160 | + "$ref": "#/components/schemas/Measurement" |
| 161 | + }, |
| 162 | + "height": { |
| 163 | + "$ref": "#/components/schemas/Measurement" |
| 164 | + }, |
| 165 | + "image": { |
| 166 | + "$ref": "#/components/schemas/BreedImage" |
63 | 167 | } |
64 | 168 | }, |
65 | 169 | "type": "object" |
66 | 170 | }, |
67 | | - "DogFact": { |
68 | | - "title": "DogFact model", |
69 | | - "description": "A single dog fact", |
| 171 | + "BreedImage": { |
| 172 | + "title": "BreedImage model", |
| 173 | + "description": "Image information for a breed", |
70 | 174 | "properties": { |
71 | 175 | "id": { |
72 | | - "title": "ID", |
73 | | - "description": "Unique identifier for the fact", |
74 | | - "type": "string" |
| 176 | + "type": "string", |
| 177 | + "description": "Image ID" |
| 178 | + }, |
| 179 | + "width": { |
| 180 | + "type": "integer", |
| 181 | + "description": "Image width in pixels" |
75 | 182 | }, |
76 | | - "type": { |
77 | | - "title": "Type", |
78 | | - "description": "Type of the resource", |
79 | | - "type": "string" |
| 183 | + "height": { |
| 184 | + "type": "integer", |
| 185 | + "description": "Image height in pixels" |
80 | 186 | }, |
81 | | - "attributes": { |
82 | | - "$ref": "#/components/schemas/DogFactAttributes" |
| 187 | + "url": { |
| 188 | + "type": "string", |
| 189 | + "description": "Image URL" |
83 | 190 | } |
84 | 191 | }, |
85 | 192 | "type": "object" |
86 | 193 | }, |
87 | | - "DogFactAttributes": { |
88 | | - "title": "DogFactAttributes model", |
89 | | - "description": "Attributes of a dog fact", |
| 194 | + "Measurement": { |
| 195 | + "title": "Measurement model", |
| 196 | + "description": "Weight or height measurement", |
90 | 197 | "properties": { |
91 | | - "body": { |
92 | | - "title": "Body", |
93 | | - "description": "The actual fact text", |
94 | | - "type": "string" |
| 198 | + "imperial": { |
| 199 | + "type": "string", |
| 200 | + "description": "Imperial measurement" |
| 201 | + }, |
| 202 | + "metric": { |
| 203 | + "type": "string", |
| 204 | + "description": "Metric measurement" |
95 | 205 | } |
96 | 206 | }, |
97 | 207 | "type": "object" |
|
100 | 210 | }, |
101 | 211 | "tags": [ |
102 | 212 | { |
103 | | - "name": "Facts", |
104 | | - "description": "Dog Facts" |
| 213 | + "name": "Breeds", |
| 214 | + "description": "Dog Breeds" |
105 | 215 | } |
106 | 216 | ], |
107 | | - "security": [[]] |
| 217 | + "security": [ |
| 218 | + { |
| 219 | + "ApiKeyAuth": [] |
| 220 | + } |
| 221 | + ] |
108 | 222 | } |
0 commit comments