Skip to content

Commit b40d59e

Browse files
author
hirsch88
committed
Add pets to swagger
1 parent e08de30 commit b40d59e

File tree

1 file changed

+266
-1
lines changed

1 file changed

+266
-1
lines changed

src/api/swagger.json

Lines changed: 266 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
},
3030
{
3131
"name": "User"
32+
},
33+
{
34+
"name": "Pet"
3235
}
3336
],
3437
"paths": {
@@ -186,7 +189,7 @@
186189
{
187190
"name": "id",
188191
"in": "path",
189-
"description": "ID of user to delete",
192+
"description": "ID of user to update",
190193
"required": true,
191194
"type": "integer",
192195
"format": "int64"
@@ -260,6 +263,220 @@
260263
}
261264
}
262265
}
266+
},
267+
"/pets": {
268+
"get": {
269+
"tags": [
270+
"Pet"
271+
],
272+
"summary": "List all pets",
273+
"description": "Returns all pets",
274+
"operationId": "FindAllPets",
275+
"security": [
276+
{
277+
"JWT": []
278+
}
279+
],
280+
"responses": {
281+
"200": {
282+
"description": "ok",
283+
"schema": {
284+
"type": "object",
285+
"properties": {
286+
"success": {
287+
"type": "boolean"
288+
},
289+
"message": {
290+
"type": "string"
291+
},
292+
"data": {
293+
"type": "array",
294+
"items": {
295+
"$ref": "#/definitions/Pet"
296+
}
297+
}
298+
}
299+
}
300+
}
301+
}
302+
},
303+
"post": {
304+
"tags": [
305+
"Pet"
306+
],
307+
"summary": "Create new pet",
308+
"description": "",
309+
"operationId": "CreatePet",
310+
"security": [
311+
{
312+
"JWT": []
313+
}
314+
],
315+
"parameters": [
316+
{
317+
"in": "body",
318+
"name": "body",
319+
"description": "User object that needs to be added to the database",
320+
"required": true,
321+
"schema": {
322+
"$ref": "#/definitions/NewPet"
323+
}
324+
}
325+
],
326+
"responses": {
327+
"201": {
328+
"description": "created",
329+
"schema": {
330+
"type": "object",
331+
"properties": {
332+
"success": {
333+
"type": "boolean"
334+
},
335+
"message": {
336+
"type": "string"
337+
},
338+
"data": {
339+
"$ref": "#/definitions/Pet"
340+
}
341+
}
342+
}
343+
}
344+
}
345+
}
346+
},
347+
"/pets/{id}": {
348+
"get": {
349+
"tags": [
350+
"Pet"
351+
],
352+
"summary": "Get pet",
353+
"description": "Returns the given pet",
354+
"operationId": "FindPet",
355+
"security": [
356+
{
357+
"JWT": []
358+
}
359+
],
360+
"parameters": [
361+
{
362+
"name": "id",
363+
"in": "path",
364+
"description": "ID of pet to return",
365+
"required": true,
366+
"type": "integer",
367+
"format": "int64"
368+
}
369+
],
370+
"responses": {
371+
"200": {
372+
"description": "ok",
373+
"schema": {
374+
"type": "object",
375+
"properties": {
376+
"success": {
377+
"type": "boolean"
378+
},
379+
"message": {
380+
"type": "string"
381+
},
382+
"data": {
383+
"$ref": "#/definitions/Pet"
384+
}
385+
}
386+
}
387+
}
388+
}
389+
},
390+
"put": {
391+
"tags": [
392+
"Pet"
393+
],
394+
"summary": "Update pet",
395+
"description": "Updates the given pet",
396+
"operationId": "UpdatePet",
397+
"security": [
398+
{
399+
"JWT": []
400+
}
401+
],
402+
"parameters": [
403+
{
404+
"name": "id",
405+
"in": "path",
406+
"description": "ID of pet to update",
407+
"required": true,
408+
"type": "integer",
409+
"format": "int64"
410+
},
411+
{
412+
"in": "body",
413+
"name": "body",
414+
"description": "Pet object that needs to be added to the database",
415+
"required": true,
416+
"schema": {
417+
"$ref": "#/definitions/NewPet"
418+
}
419+
}
420+
],
421+
"responses": {
422+
"200": {
423+
"description": "ok",
424+
"schema": {
425+
"type": "object",
426+
"properties": {
427+
"success": {
428+
"type": "boolean"
429+
},
430+
"message": {
431+
"type": "string"
432+
},
433+
"data": {
434+
"$ref": "#/definitions/Pet"
435+
}
436+
}
437+
}
438+
}
439+
}
440+
},
441+
"delete": {
442+
"tags": [
443+
"Pet"
444+
],
445+
"summary": "Delete pet",
446+
"description": "Removes the given pet",
447+
"operationId": "DeletePet",
448+
"security": [
449+
{
450+
"JWT": []
451+
}
452+
],
453+
"parameters": [
454+
{
455+
"name": "id",
456+
"in": "path",
457+
"description": "ID of pet to delete",
458+
"required": true,
459+
"type": "integer",
460+
"format": "int64"
461+
}
462+
],
463+
"responses": {
464+
"200": {
465+
"description": "ok",
466+
"schema": {
467+
"type": "object",
468+
"properties": {
469+
"success": {
470+
"type": "boolean"
471+
},
472+
"message": {
473+
"type": "string"
474+
}
475+
}
476+
}
477+
}
478+
}
479+
}
263480
}
264481
},
265482
"definitions": {
@@ -280,6 +497,22 @@
280497
}
281498
}
282499
},
500+
"NewPet": {
501+
"type": "object",
502+
"properties": {
503+
"name": {
504+
"type": "string"
505+
},
506+
"age": {
507+
"type": "integer",
508+
"format": "int64"
509+
},
510+
"userId": {
511+
"type": "integer",
512+
"format": "int64"
513+
}
514+
}
515+
},
283516
"User": {
284517
"title": "User",
285518
"allOf": [
@@ -304,6 +537,38 @@
304537
}
305538
}
306539
]
540+
},
541+
"Pet": {
542+
"title": "Pet",
543+
"allOf": [
544+
{
545+
"type": "object",
546+
"properties": {
547+
"id": {
548+
"type": "integer",
549+
"format": "int64"
550+
},
551+
"name": {
552+
"type": "string"
553+
},
554+
"age": {
555+
"type": "integer",
556+
"format": "int64"
557+
},
558+
"user": {
559+
"$ref": "#/definitions/User"
560+
},
561+
"updatedAt": {
562+
"type": "string",
563+
"format": "date-time"
564+
},
565+
"createdAt": {
566+
"type": "string",
567+
"format": "date-time"
568+
}
569+
}
570+
}
571+
]
307572
}
308573
}
309574
}

0 commit comments

Comments
 (0)