refactor(api): replace Error schema with ProblemDetails (RFC 7807)
This commit is contained in:
parent
d1c6eb0069
commit
32038981f6
1 changed files with 50 additions and 33 deletions
|
|
@ -36,7 +36,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
post:
|
post:
|
||||||
summary: Create a new training
|
summary: Create a new training
|
||||||
operationId: createTraining
|
operationId: createTraining
|
||||||
|
|
@ -60,13 +60,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
/trainings/{trainingID}:
|
/trainings/{trainingID}:
|
||||||
get:
|
get:
|
||||||
summary: Get a training by ID
|
summary: Get a training by ID
|
||||||
|
|
@ -95,13 +95,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
put:
|
put:
|
||||||
summary: Update a training by ID
|
summary: Update a training by ID
|
||||||
operationId: updateTraining
|
operationId: updateTraining
|
||||||
|
|
@ -135,19 +135,19 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
"400":
|
"400":
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
delete:
|
delete:
|
||||||
summary: Delete a training by ID
|
summary: Delete a training by ID
|
||||||
|
|
@ -172,13 +172,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates:
|
/trainings/{trainingID}/dates:
|
||||||
get:
|
get:
|
||||||
|
|
@ -210,7 +210,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
post:
|
post:
|
||||||
summary: Create a new date for a training
|
summary: Create a new date for a training
|
||||||
|
|
@ -245,13 +245,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates/{dateID}:
|
/trainings/{trainingID}/dates/{dateID}:
|
||||||
delete:
|
delete:
|
||||||
|
|
@ -286,13 +286,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
put:
|
put:
|
||||||
summary: Update a date of a training
|
summary: Update a date of a training
|
||||||
operationId: updateTrainingDate
|
operationId: updateTrainingDate
|
||||||
|
|
@ -335,19 +335,19 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
"400":
|
"400":
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates/{dateID}/attendees:
|
/trainings/{trainingID}/dates/{dateID}/attendees:
|
||||||
get:
|
get:
|
||||||
|
|
@ -388,7 +388,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
post:
|
post:
|
||||||
summary: Add an attendee to a date of a training
|
summary: Add an attendee to a date of a training
|
||||||
|
|
@ -426,13 +426,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}:
|
/trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}:
|
||||||
delete:
|
delete:
|
||||||
|
|
@ -476,13 +476,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}/feedback:
|
/trainings/{trainingID}/dates/{dateID}/attendees/{attendeeID}/feedback:
|
||||||
post:
|
post:
|
||||||
|
|
@ -536,13 +536,13 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
default:
|
default:
|
||||||
description: Unexpected error
|
description: Unexpected error
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/dates/{dateID}/feedback:
|
/trainings/{trainingID}/dates/{dateID}/feedback:
|
||||||
get:
|
get:
|
||||||
|
|
@ -583,7 +583,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/{trainingID}/feedback:
|
/trainings/{trainingID}/feedback:
|
||||||
get:
|
get:
|
||||||
|
|
@ -615,7 +615,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
|
|
||||||
/trainings/upcoming-dates:
|
/trainings/upcoming-dates:
|
||||||
get:
|
get:
|
||||||
|
|
@ -662,7 +662,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/ProblemDetails"
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
NewTraining:
|
NewTraining:
|
||||||
|
|
@ -812,13 +812,30 @@ components:
|
||||||
format: float
|
format: float
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
|
||||||
Error:
|
ProblemDetails:
|
||||||
type: object
|
type: object
|
||||||
|
description: >
|
||||||
|
Schema that carries the details of an error in an HTTP response.
|
||||||
|
See https://datatracker.ietf.org/doc/html/rfc7807 for more information.
|
||||||
properties:
|
properties:
|
||||||
code:
|
type:
|
||||||
type: string
|
type: string
|
||||||
message:
|
description: A URI reference that identifies the problem type.
|
||||||
|
title:
|
||||||
type: string
|
type: string
|
||||||
|
description: A human-readable summary of the problem type.
|
||||||
|
status:
|
||||||
|
type: integer
|
||||||
|
description: The HTTP status code generated by the origin server for this occurrence of the problem.
|
||||||
|
detail:
|
||||||
|
type: string
|
||||||
|
description: A human-readable explanation specific to this occurrence of the problem.
|
||||||
|
instance:
|
||||||
|
type: string
|
||||||
|
description: A URI reference that identifies the specific occurrence of the problem.
|
||||||
required:
|
required:
|
||||||
- code
|
- type
|
||||||
- message
|
- title
|
||||||
|
- status
|
||||||
|
- detail
|
||||||
|
- instance
|
||||||
|
|
|
||||||
Reference in a new issue