|
16 | 16 | "description": "The JSON Schemas you can reuse inside endpoint definitions using `ref`. You can either pass the JSON Schema object, or a bas64 string.",
|
17 | 17 | "examples": [
|
18 | 18 | {
|
19 |
| - "Pet": { |
20 |
| - "type": "object", |
21 |
| - "required": [ |
22 |
| - "id", |
23 |
| - "name" |
24 |
| - ] |
25 |
| - } |
| 19 | + "Pet": { |
| 20 | + "type": "object", |
| 21 | + "required": [ |
| 22 | + "id", |
| 23 | + "name" |
| 24 | + ] |
| 25 | + } |
26 | 26 | }
|
27 |
| - ], |
28 |
| - "patternProperties":{ |
| 27 | + ], |
| 28 | + "patternProperties": { |
29 | 29 | ".*": {
|
30 | 30 | "title": "JSON Schema",
|
31 | 31 | "description": "JSON Schema in base64 or as an object",
|
32 |
| - "type":["string","object"] |
| 32 | + "type": [ |
| 33 | + "string", |
| 34 | + "object" |
| 35 | + ] |
33 | 36 | }
|
34 | 37 | }
|
35 | 38 | },
|
|
132 | 135 | "tags": {
|
133 | 136 | "$id": "#documentation/openapi/tags",
|
134 | 137 | "title": "Tags",
|
135 |
| - "description": "You can assign a list of tags to each API operation. Tagged operations may be handled differently by tools and libraries. For example, Swagger UI uses tags to group the displayed operations.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", |
| 138 | + "description": "You can assign a list of tags to each API operation. If you declare tags in the `tag_definition` at the OpenAPI service level, they will have a description in the documentation. Tagged operations may be handled differently by tools and libraries. For example, Swagger UI uses tags to group the displayed operations.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", |
136 | 139 | "type": "array"
|
137 | 140 | },
|
138 | 141 | "schemes": {
|
|
172 | 175 | "string"
|
173 | 176 | ]
|
174 | 177 | },
|
| 178 | + "operation_id": { |
| 179 | + "$id": "#documentation/openapi/example", |
| 180 | + "title": "Operation ID", |
| 181 | + "description": "A unique string identifying the operation identifier. Usually the method + the endpoint. If provided, these IDs must be unique among all operations described in your API.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", |
| 182 | + "type": "string", |
| 183 | + "examples": [ |
| 184 | + "GET/foo" |
| 185 | + ] |
| 186 | + }, |
| 187 | + "tag_definition": { |
| 188 | + "$id": "#documentation/openapi/tag_definition", |
| 189 | + "title": "Tag definition", |
| 190 | + "description": "Sets a description for the tags classifiying endpoints when generating the OpenAPI spec.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", |
| 191 | + "type": "array", |
| 192 | + "items": { |
| 193 | + "type": "object", |
| 194 | + "required": [ |
| 195 | + "name" |
| 196 | + ], |
| 197 | + "additionalProperties": false, |
| 198 | + "patternProperties": { |
| 199 | + "^[@$_#]": {} |
| 200 | + }, |
| 201 | + "properties": { |
| 202 | + "name": { |
| 203 | + "type": "string" |
| 204 | + }, |
| 205 | + "description": { |
| 206 | + "type": "string" |
| 207 | + } |
| 208 | + } |
| 209 | + }, |
| 210 | + "examples": [ |
| 211 | + [ |
| 212 | + { |
| 213 | + "name": "Tag1", |
| 214 | + "description": "Description of tag1" |
| 215 | + } |
| 216 | + ] |
| 217 | + ] |
| 218 | + }, |
| 219 | + "query_definition": { |
| 220 | + "$id": "#documentation/openapi/query_definition", |
| 221 | + "title": "Query definition", |
| 222 | + "description": "Sets a description for the query strings allowed in the endpoint. Make sure to include the same strings in the endpoint's `input_query_strings`.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", |
| 223 | + "type": "array", |
| 224 | + "items": { |
| 225 | + "type": "object", |
| 226 | + "required": [ |
| 227 | + "name" |
| 228 | + ], |
| 229 | + "additionalProperties": false, |
| 230 | + "patternProperties": { |
| 231 | + "^[@$_#]": {} |
| 232 | + }, |
| 233 | + "properties": { |
| 234 | + "name": { |
| 235 | + "type": "string" |
| 236 | + }, |
| 237 | + "description": { |
| 238 | + "type": "string" |
| 239 | + } |
| 240 | + } |
| 241 | + }, |
| 242 | + "examples": [ |
| 243 | + [ |
| 244 | + { |
| 245 | + "name": "page", |
| 246 | + "description": "The number of the page" |
| 247 | + } |
| 248 | + ] |
| 249 | + ] |
| 250 | + }, |
175 | 251 | "response_definition": {
|
176 | 252 | "$id": "#documentation/openapi/response_definition",
|
177 | 253 | "title": "Definition of errors (OAS3 only)",
|
|
183 | 259 | {
|
184 | 260 | "404": {
|
185 | 261 | "@comment": "Some comment",
|
186 |
| - "description": "Page not found", |
187 |
| - "example": { |
| 262 | + "description": "Page not found", |
| 263 | + "example": { |
188 | 264 | "status": "KO"
|
189 |
| - }, |
190 |
| - "content_type": "application/json" |
191 |
| - } |
| 265 | + }, |
| 266 | + "content_type": "application/json" |
| 267 | + } |
192 | 268 | }
|
193 | 269 | ],
|
194 | 270 | "additionalProperties": false,
|
195 |
| - "patternProperties":{ |
| 271 | + "patternProperties": { |
196 | 272 | "default|^[0-9]+$": {
|
197 | 273 | "type": "object",
|
198 | 274 | "additionalProperties": false,
|
199 | 275 | "patternProperties": {
|
200 | 276 | "^[@$_#]": {}
|
201 | 277 | },
|
202 |
| - "required": ["content_type"], |
| 278 | + "required": [ |
| 279 | + "content_type" |
| 280 | + ], |
203 | 281 | "properties": {
|
204 | 282 | "ref": {
|
205 | 283 | "type": "string",
|
206 | 284 | "title": "Reference",
|
207 | 285 | "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request. Notice that the path `#/components/schemas/` is not needed.",
|
208 |
| - "examples": ["your_schema_name"] |
209 |
| - |
| 286 | + "examples": [ |
| 287 | + "your_schema_name" |
| 288 | + ] |
210 | 289 | },
|
211 | 290 | "description": {
|
212 |
| - "type": ["string"], |
| 291 | + "type": [ |
| 292 | + "string" |
| 293 | + ], |
213 | 294 | "title": "Description",
|
214 | 295 | "description": "The description of this error code, e.g., `Page not found`.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/"
|
215 | 296 | },
|
216 | 297 | "example_schema": {
|
217 |
| - "type": ["string","object"], |
| 298 | + "type": [ |
| 299 | + "string", |
| 300 | + "object" |
| 301 | + ], |
218 | 302 | "description": "A JSON schema that describes the response format for the endpoint, directly as a JSON object, or encoded as a base64 string. Use either example or example_schema, but not both."
|
219 | 303 | },
|
220 | 304 | "example": {
|
221 |
| - "type": ["string","object","array","boolean","integer","null","number"], |
| 305 | + "type": [ |
| 306 | + "string", |
| 307 | + "object", |
| 308 | + "array", |
| 309 | + "boolean", |
| 310 | + "integer", |
| 311 | + "null", |
| 312 | + "number" |
| 313 | + ], |
222 | 314 | "title": "Content Type",
|
223 | 315 | "description": "A free form JSON object or a string you would like to show as a sample response of the endpoint. The examples assume they are JSON content types except when using the `output_encoding=string`.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/"
|
224 | 316 | },
|
|
240 | 332 | ],
|
241 | 333 | "examples": [
|
242 | 334 | {
|
243 |
| - |
244 | 335 | "@comment": "Some comment",
|
245 |
| - "description": "Page not found", |
246 |
| - "example": { |
| 336 | + "description": "Page not found", |
| 337 | + "example": { |
247 | 338 | "status": "KO"
|
248 |
| - }, |
249 |
| - "content_type": "application/json" |
| 339 | + }, |
| 340 | + "content_type": "application/json" |
250 | 341 | }
|
251 | 342 | ],
|
252 | 343 | "additionalProperties": false,
|
253 | 344 | "patternProperties": {
|
254 | 345 | "^[@$_#]": {}
|
255 | 346 | },
|
256 |
| - "required": ["content_type"], |
| 347 | + "required": [ |
| 348 | + "content_type" |
| 349 | + ], |
257 | 350 | "properties": {
|
258 | 351 | "ref": {
|
259 | 352 | "type": "string",
|
260 | 353 | "title": "Reference",
|
261 | 354 | "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request. Notice that the path `#/components/schemas/` is not needed.",
|
262 |
| - "examples": ["your_schema_name"] |
263 |
| - |
| 355 | + "examples": [ |
| 356 | + "your_schema_name" |
| 357 | + ] |
264 | 358 | },
|
265 | 359 | "description": {
|
266 |
| - "type": ["string"], |
| 360 | + "type": [ |
| 361 | + "string" |
| 362 | + ], |
267 | 363 | "title": "Description",
|
268 | 364 | "description": "The description of the payload this endpoint accepts.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/"
|
269 | 365 | },
|
270 | 366 | "example_schema": {
|
271 |
| - "type": ["string","object"], |
| 367 | + "type": [ |
| 368 | + "string", |
| 369 | + "object" |
| 370 | + ], |
272 | 371 | "description": "A JSON schema that describes the request format for the accepted payload in the endpoint. Use either example or example_schema, but not both."
|
273 | 372 | },
|
274 | 373 | "example": {
|
275 |
| - "type": ["string","object","array","boolean","integer","null","number"], |
| 374 | + "type": [ |
| 375 | + "string", |
| 376 | + "object", |
| 377 | + "array", |
| 378 | + "boolean", |
| 379 | + "integer", |
| 380 | + "null", |
| 381 | + "number" |
| 382 | + ], |
276 | 383 | "title": "Content Type",
|
277 | 384 | "description": "A free form JSON object or a string you would like to show as a sample response of the endpoint. The examples assume they are JSON content types except when using the `output_encoding=string`.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/"
|
278 | 385 | },
|
|
0 commit comments