-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yaml
More file actions
111 lines (108 loc) · 2.36 KB
/
swagger.yaml
File metadata and controls
111 lines (108 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
swagger: '2.0'
info:
title: Pet Shop Example API
version: "0.1"
consumes:
- application/json
produces:
- application/json
paths:
/pets:
get:
tags: [Pets]
operationId: app.get_pets
summary: Get all pets
parameters:
- name: animal_type
in: query
type: string
pattern: "^[a-zA-Z0-9]*$"
- name: limit
in: query
type: integer
minimum: 0
default: 100
responses:
200:
description: Return pets
schema:
type: array
items:
$ref: '#/definitions/Pet'
/pets/{pet_id}:
get:
tags: [Pets]
operationId: app.get_pet
summary: Get a single pet
parameters:
- $ref: '#/parameters/pet_id'
responses:
200:
description: Return pet
schema:
$ref: '#/definitions/Pet'
404:
description: Pet does not exist
put:
tags: [Pets]
operationId: app.put_pet
summary: Create or update a pet
parameters:
- $ref: '#/parameters/pet_id'
- name: pet
in: body
schema:
$ref: '#/definitions/Pet'
responses:
200:
description: Pet updated
201:
description: New pet created
delete:
tags: [Pets]
operationId: app.delete_pet
summary: Remove a pet
parameters:
- $ref: '#/parameters/pet_id'
responses:
204:
description: Pet was deleted
404:
description: Pet does not exist
parameters:
pet_id:
name: pet_id
description: Pet's Unique identifier
in: path
type: string
required: true
pattern: "^[a-zA-Z0-9-]+$"
definitions:
Pet:
type: object
required:
- name
- animal_type
properties:
id:
type: string
description: Unique identifier
example: "123"
readOnly: true
name:
type: string
description: Pet's name
example: "Susie"
minLength: 1
maxLength: 100
animal_type:
type: string
description: Kind of animal
example: "cat"
minLength: 1
created:
type: string
format: date-time
description: Creation time
example: "2015-07-07T15:49:51.230+02:00"
readOnly: true