This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
/
swagger.yaml
132 lines (127 loc) · 2.92 KB
/
swagger.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
swagger: '2.0'
info:
title: Pet Shop Example API
version: "0.1"
description: Simple example API to store and retrieve pets
consumes:
- application/json
produces:
- application/json
security:
# enable OAuth protection for all REST endpoints
# (only active if the TOKENINFO_URL environment variable is set)
- oauth2: [uid]
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
format: int32
minimum: 0
default: 100
responses:
200:
description: Return pets
schema:
type: object
properties:
pets:
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
tags:
type: object
description: Custom tags
created:
type: string
format: date-time
description: Creation time
example: "2015-07-07T15:49:51.230+02:00"
readOnly: true
securityDefinitions:
oauth2:
type: oauth2
flow: implicit
authorizationUrl: https://example.com/oauth2/dialog
scopes:
uid: Unique identifier of the user accessing the service.