source: TFP-WebServer/MarkersMod/src/Markers.openapi.yaml@ 489

Last change on this file since 489 was 487, checked in by alloc, 5 months ago

1.1.0.1 Release for V 1.0

File size: 6.4 KB
RevLine 
[459]1openapi: 3.1.0
2info:
3 title: Markers
[460]4 version: '1'
[459]5
6components:
7 schemas:
8 MarkerId:
9 type: string
10 format: uuid
11 description: Unique identifier of the marker
12
13 MarkersElement:
14 type: object
15 properties:
16 id:
17 $ref: '#/components/schemas/MarkerId'
18 x:
19 type: integer
20 examples:
21 - -57
22 y:
23 type: integer
24 examples:
25 - 321
[487]26 name:
27 type:
28 - string
29 - 'null'
30 examples:
31 - My House
32 description: Name shown with the marker
[459]33 icon:
34 type:
35 - string
36 - 'null'
37 format: uri
38 examples:
39 - https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Blue_question_mark_icon.svg/1200px-Blue_question_mark_icon.svg.png
40 description: Icon used for the marker
41 required:
42 - id
43 - x
44 - y
[487]45 - name
46 - icon
[459]47
48 MarkersList:
49 type: array
50 items:
51 $ref: '#/components/schemas/MarkersElement'
52
53
54 requestBodies:
55 MarkersBodyIn:
56 content:
57 application/json:
58 schema:
59 type: object
60 properties:
61 x:
62 type: integer
63 examples:
64 - -43
65 y:
66 type: integer
67 examples:
68 - 842
[487]69 name:
70 type:
71 - string
72 - 'null'
73 examples:
74 - My House
[459]75 icon:
[487]76 type:
77 - string
78 - 'null'
[459]79 format: uuid
80 examples:
81 - https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Blue_question_mark_icon.svg/1200px-Blue_question_mark_icon.svg.png
82 required:
83 - x
84 - y
85 required: true
86
87
88 responses:
89 MarkersBodyOut:
90 description: Found marker
91 content:
92 application/json:
93 schema:
94 type: object
95 properties:
96 data:
97 $ref: '#/components/schemas/MarkersList'
98 meta:
[460]99 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
[459]100 required:
101 - data
102 - meta
103
104 MarkersIdOut:
105 description: Created marker's ID
106 content:
107 application/json:
108 schema:
109 type: object
110 properties:
111 data:
112 type: string
113 format: uuid
114 meta:
[460]115 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
[459]116 required:
117 - data
118 - meta
119
120
121 parameters:
122 MarkerIdParameter:
123 name: id
124 in: path
125 required: true
126 schema:
127 type: string
128 format: uuid
[460]129 description: ID of marker to fetch
[459]130
131
132paths:
133 /api/markers:
134 get:
135 tags:
136 - Map
137 summary: Markers list
[460]138 description: Fetch a list of all defined map markers
[459]139 operationId: markers.get
140 responses:
141 200:
142 description: List of found markers
143 $ref: '#/components/responses/MarkersBodyOut'
144
145 post:
146 tags:
147 - Map
148 summary: Marker create
149 description: Create a new map marker
150 operationId: markers.post
151 requestBody:
152 $ref: '#/components/requestBodies/MarkersBodyIn'
153 responses:
154 201:
155 description: Marker with updated values
156 $ref: '#/components/responses/MarkersIdOut'
157 400:
158 description: >-
159 Invalid request body, errorCode will be one of 'NO_OR_INVALID_X',
160 'NO_OR_INVALID_Y'
[460]161 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]162 403:
[460]163 $ref: './openapi.yaml#/components/responses/Unauthorized'
[459]164 security:
165 - apiTokenName: []
166 apiTokenSecret: []
167 - sessionCookie: []
168
169 /api/markers/{id}:
170 get:
171 tags:
172 - Map
173 summary: Marker show
174 description: Fetch a single defined map marker
175 operationId: markers.get.id
176 parameters:
177 - $ref: '#/components/parameters/MarkerIdParameter'
178 responses:
179 200:
180 description: Single found marker
181 $ref: '#/components/responses/MarkersBodyOut'
182 404:
183 description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
[460]184 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]185
186 put:
187 tags:
188 - Map
189 summary: Marker update
190 description: Update a single defined map marker
191 operationId: markers.put.id
192 parameters:
193 - $ref: '#/components/parameters/MarkerIdParameter'
194 requestBody:
195 $ref: '#/components/requestBodies/MarkersBodyIn'
196 responses:
197 200:
198 description: Marker with updated values
199 $ref: '#/components/responses/MarkersBodyOut'
200 400:
201 description: >-
202 Invalid request body, errorCode will be one of 'NO_OR_INVALID_X',
203 'NO_OR_INVALID_Y'
[460]204 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]205 404:
206 description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
[460]207 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]208 403:
[460]209 $ref: './openapi.yaml#/components/responses/Unauthorized'
[459]210 security:
211 - apiTokenName: []
212 apiTokenSecret: []
213 - sessionCookie: []
214
215 delete:
216 tags:
217 - Map
218 summary: Marker delete
219 description: Delete a single defined map marker
220 operationId: markers.delete.id
221 parameters:
222 - $ref: '#/components/parameters/MarkerIdParameter'
223 responses:
224 204:
225 description: Deleted marker
[460]226 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]227 404:
228 description: Marker ID not found
[460]229 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
[459]230 403:
[460]231 $ref: './openapi.yaml#/components/responses/Unauthorized'
[459]232 security:
233 - apiTokenName: []
234 apiTokenSecret: []
235 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.