|
| 1 | +openapi: 3.0.1 |
| 2 | +info: |
| 3 | + title: A TODO-Task application |
| 4 | + description: A simple application to handle tasks. |
| 5 | + version: 1.0.0 |
| 6 | + license: |
| 7 | + name: Eclipse Public License 2.0 |
| 8 | + url: 'https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html' |
| 9 | +servers: |
| 10 | + - url: 'http://localhost:8080/todoapp' |
| 11 | +tags: |
| 12 | +- name: task |
| 13 | + description: All task related operations |
| 14 | +- name: person |
| 15 | + description: All person related operations |
| 16 | +- name: models |
| 17 | + x-displayName: All Models |
| 18 | + description: | |
| 19 | + ## Task |
| 20 | + <SchemaDefinition schemaRef="#/components/schemas/Task" /> |
| 21 | + |
| 22 | + ## Person |
| 23 | + <SchemaDefinition schemaRef="#/components/schemas/Person" /> |
| 24 | + |
| 25 | + ## Error |
| 26 | + <SchemaDefinition schemaRef="#/components/schemas/Error" /> |
| 27 | +x-tagGroups: |
| 28 | + - name: Operations |
| 29 | + tags: |
| 30 | + - task |
| 31 | + - person |
| 32 | + - name: Models |
| 33 | + tags: |
| 34 | + - models |
| 35 | +paths: |
| 36 | + /task: |
| 37 | + get: |
| 38 | + tags: |
| 39 | + - task |
| 40 | + summary: Get the list of all tasks |
| 41 | + operationId: tasksGetAll |
| 42 | + responses: |
| 43 | + 200: |
| 44 | + description: List of all tasks |
| 45 | + content: |
| 46 | + application/json: |
| 47 | + schema: |
| 48 | + type: array |
| 49 | + items: |
| 50 | + $ref: '#/components/schemas/Task' |
| 51 | + default: |
| 52 | + description: Generic error response |
| 53 | + content: |
| 54 | + application/json: |
| 55 | + schema: |
| 56 | + $ref: '#/components/schemas/Error' |
| 57 | + post: |
| 58 | + tags: |
| 59 | + - task |
| 60 | + summary: Create a new task |
| 61 | + operationId: tasksCreate |
| 62 | + requestBody: |
| 63 | + content: |
| 64 | + application/json: |
| 65 | + schema: |
| 66 | + $ref: '#/components/schemas/Task' |
| 67 | + responses: |
| 68 | + 200: |
| 69 | + description: The created task |
| 70 | + content: |
| 71 | + application/json: |
| 72 | + schema: |
| 73 | + $ref: '#/components/schemas/Task' |
| 74 | + default: |
| 75 | + description: Generic error response |
| 76 | + content: |
| 77 | + application/json: |
| 78 | + schema: |
| 79 | + $ref: '#/components/schemas/Error' |
| 80 | + /task/{taskId}: |
| 81 | + parameters: |
| 82 | + - name: taskId |
| 83 | + in: path |
| 84 | + description: The id of the task |
| 85 | + required: true |
| 86 | + schema: |
| 87 | + type: string |
| 88 | + example: e1cb23d0-6cbe-4a29-b586-bfa424bc93fd |
| 89 | + get: |
| 90 | + tags: |
| 91 | + - task |
| 92 | + summary: Get a single task based on its id |
| 93 | + operationId: tasksRead |
| 94 | + responses: |
| 95 | + 200: |
| 96 | + description: Ok |
| 97 | + content: |
| 98 | + application/json: |
| 99 | + schema: |
| 100 | + $ref: '#/components/schemas/Task' |
| 101 | + default: |
| 102 | + description: Generic error response |
| 103 | + content: |
| 104 | + application/json: |
| 105 | + schema: |
| 106 | + $ref: '#/components/schemas/Error' |
| 107 | + put: |
| 108 | + tags: |
| 109 | + - task |
| 110 | + summary: Update an existing task |
| 111 | + operationId: tasksUpdate |
| 112 | + requestBody: |
| 113 | + content: |
| 114 | + application/json: |
| 115 | + schema: |
| 116 | + $ref: '#/components/schemas/Task' |
| 117 | + responses: |
| 118 | + 200: |
| 119 | + description: The updated task |
| 120 | + content: |
| 121 | + application/json: |
| 122 | + schema: |
| 123 | + $ref: '#/components/schemas/Task' |
| 124 | + default: |
| 125 | + description: Generic error response |
| 126 | + content: |
| 127 | + application/json: |
| 128 | + schema: |
| 129 | + $ref: '#/components/schemas/Error' |
| 130 | + delete: |
| 131 | + tags: |
| 132 | + - task |
| 133 | + summary: Delete an existing task |
| 134 | + operationId: tasksDelete |
| 135 | + responses: |
| 136 | + 204: |
| 137 | + description: Task deleted response |
| 138 | + default: |
| 139 | + description: Generic error response |
| 140 | + content: |
| 141 | + application/json: |
| 142 | + schema: |
| 143 | + $ref: '#/components/schemas/Error' |
| 144 | + /person: |
| 145 | + get: |
| 146 | + tags: |
| 147 | + - person |
| 148 | + summary: Get the list of all persons |
| 149 | + operationId: personsGetAll |
| 150 | + responses: |
| 151 | + 200: |
| 152 | + description: List of all persons |
| 153 | + content: |
| 154 | + application/json: |
| 155 | + schema: |
| 156 | + type: array |
| 157 | + items: |
| 158 | + $ref: '#/components/schemas/Person' |
| 159 | + default: |
| 160 | + description: Generic error response |
| 161 | + content: |
| 162 | + application/json: |
| 163 | + schema: |
| 164 | + $ref: '#/components/schemas/Error' |
| 165 | + post: |
| 166 | + tags: |
| 167 | + - person |
| 168 | + summary: Create a new person |
| 169 | + operationId: personsCreate |
| 170 | + requestBody: |
| 171 | + content: |
| 172 | + application/json: |
| 173 | + schema: |
| 174 | + $ref: '#/components/schemas/Person' |
| 175 | + responses: |
| 176 | + 200: |
| 177 | + description: The created person |
| 178 | + content: |
| 179 | + application/json: |
| 180 | + schema: |
| 181 | + $ref: '#/components/schemas/Person' |
| 182 | + default: |
| 183 | + description: Generic error response |
| 184 | + content: |
| 185 | + application/json: |
| 186 | + schema: |
| 187 | + $ref: '#/components/schemas/Error' |
| 188 | + /person/{personId}: |
| 189 | + parameters: |
| 190 | + - name: personId |
| 191 | + in: path |
| 192 | + description: The id of the person |
| 193 | + required: true |
| 194 | + schema: |
| 195 | + type: string |
| 196 | + example: 55f1b942-207f-4634-9b85-97847b8c6e82 |
| 197 | + get: |
| 198 | + tags: |
| 199 | + - person |
| 200 | + summary: Get a single person based on its id |
| 201 | + operationId: personsRead |
| 202 | + responses: |
| 203 | + 200: |
| 204 | + description: Ok |
| 205 | + content: |
| 206 | + application/json: |
| 207 | + schema: |
| 208 | + $ref: '#/components/schemas/Person' |
| 209 | + default: |
| 210 | + description: Generic error response |
| 211 | + content: |
| 212 | + application/json: |
| 213 | + schema: |
| 214 | + $ref: '#/components/schemas/Error' |
| 215 | + put: |
| 216 | + tags: |
| 217 | + - person |
| 218 | + summary: Update an existing person |
| 219 | + operationId: personsUpdate |
| 220 | + requestBody: |
| 221 | + content: |
| 222 | + application/json: |
| 223 | + schema: |
| 224 | + $ref: '#/components/schemas/Person' |
| 225 | + responses: |
| 226 | + 200: |
| 227 | + description: The updated person |
| 228 | + content: |
| 229 | + application/json: |
| 230 | + schema: |
| 231 | + $ref: '#/components/schemas/Person' |
| 232 | + default: |
| 233 | + description: Generic error response |
| 234 | + content: |
| 235 | + application/json: |
| 236 | + schema: |
| 237 | + $ref: '#/components/schemas/Error' |
| 238 | + delete: |
| 239 | + tags: |
| 240 | + - person |
| 241 | + summary: Delete an existing person |
| 242 | + operationId: personsDelete |
| 243 | + responses: |
| 244 | + 204: |
| 245 | + description: Person deleted response |
| 246 | + default: |
| 247 | + description: Generic error response |
| 248 | + content: |
| 249 | + application/json: |
| 250 | + schema: |
| 251 | + $ref: '#/components/schemas/Error' |
| 252 | +components: |
| 253 | + schemas: |
| 254 | + Task: |
| 255 | + description: Object representing a Task |
| 256 | + required: |
| 257 | + - description |
| 258 | + type: object |
| 259 | + properties: |
| 260 | + id: |
| 261 | + description: id of the taks |
| 262 | + type: string |
| 263 | + readOnly: true |
| 264 | + example: e1cb23d0-6cbe-4a29-b586-bfa424bc93fd |
| 265 | + description: |
| 266 | + description: description of the task |
| 267 | + type: string |
| 268 | + example: My important task |
| 269 | + author: |
| 270 | + $ref: "#/components/schemas/Person" |
| 271 | + assignee: |
| 272 | + $ref: "#/components/schemas/Person" |
| 273 | + completed: |
| 274 | + description: indicates if a taks is completed or not |
| 275 | + type: boolean |
| 276 | + Person: |
| 277 | + description: Object representing a Person |
| 278 | + type: object |
| 279 | + properties: |
| 280 | + id: |
| 281 | + description: id of the taks |
| 282 | + type: string |
| 283 | + readOnly: true |
| 284 | + example: 55f1b942-207f-4634-9b85-97847b8c6e82 |
| 285 | + firstName: |
| 286 | + description: first name of the person |
| 287 | + type: string |
| 288 | + example: John |
| 289 | + lastName: |
| 290 | + description: last name of the person |
| 291 | + type: string |
| 292 | + example: Doe |
| 293 | + Error: |
| 294 | + description: Object representing an error |
| 295 | + type: object |
| 296 | + properties: |
| 297 | + code: |
| 298 | + format: int32 |
| 299 | + description: Error code that identify of the error |
| 300 | + type: integer |
| 301 | + example: "1000" |
| 302 | + message: |
| 303 | + description: Short description of the error |
| 304 | + type: string |
| 305 | + example: Could not perform the task |
0 commit comments