-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
executable file
·147 lines (141 loc) · 3.6 KB
/
openapi.yml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
openapi: 3.0.3
info:
version: 0.0.1
title: 'Contacts API REST'
description: Contacts API for management a Contact List
termsOfService: https://swagger.io/terms/
license:
name: MIT
url: LICENCE
tags:
- name: Contacts
description: Everything about Contacts
servers:
- url: http://localhost:8080/
description: 'DEV: Please configure according to your local environment.'
paths:
/contacts:
get:
tags:
- Contacts
summary: Get all contacts
responses:
200:
description: A JSON array of contacts
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Contact'
404:
description: Endpoint no found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Contacts
summary: Create a new contact
responses:
201:
description: Created
400:
description: Bad request. Contact ID must be an integer and larger than 0.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
5XX:
description: Unexpected error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/contacts/{id}:
parameters:
- name: id
description: The unique identifier of the contact
in: path
required: true
schema:
$ref: '#/components/schemas/ContactId'
get:
tags:
- Contacts
summary: Get a contact
responses:
200:
description: A new contact have been created
content:
application/json:
schema:
$ref: '#/components/schemas/Contact'
404:
description: No contact found for the provided `contactId`
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ContactId:
description: The unique identifier of a contact
Contact:
type: object
properties:
id:
type: integer
firstname:
type: string
lastname:
type: string
phone:
type: string
required:
- id
- firstname
- phone
ApiResponse:
type: object
properties:
Info:
type: object
properties:
count:
type: integer
description: The length of the response
pages:
type: integer
description: Link to the next page (if it exists)
next:
type: string
description: Link to the next page of resources
prev:
type: string
description: Link to the previous page (if it exists)
ErrorResponse:
type: object
properties:
code:
type: string
description: An error code of business
message:
type: string
description: A human-readable error message
required:
- code
- message