Skip to content

Commit 7d5d085

Browse files
committed
feat(openapi): make the description pass the reunite starter rules
1 parent 57b7837 commit 7d5d085

40 files changed

Lines changed: 341 additions & 20 deletions

‎openapi/components/responses/BadRequest.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,19 @@ content:
33
application/problem+json:
44
schema:
55
$ref: ../schemas/Error.yaml
6+
examples:
7+
ValidationFailed:
8+
summary: Request body failed validation
9+
dataValue:
10+
type: about:blank
11+
title: Validation failed
12+
status: 400
13+
instance: /orders
14+
details:
15+
errors:
16+
- code: invalid_type
17+
expected: string
18+
received: undefined
19+
path:
20+
- customerName
21+
message: Required

‎openapi/components/responses/Conflict.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ content:
33
application/problem+json:
44
schema:
55
$ref: ../schemas/Error.yaml
6+
examples:
7+
DuplicateName:
8+
summary: Menu item name is already taken
9+
dataValue:
10+
type: about:blank
11+
title: A menu item with the name "coffee" already exists
12+
status: 409
13+
instance: /menu

‎openapi/components/responses/Forbidden.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ content:
33
application/problem+json:
44
schema:
55
$ref: ../schemas/Error.yaml
6+
examples:
7+
InsufficientScopes:
8+
summary: Access token lacks the required scope
9+
dataValue:
10+
type: about:blank
11+
title: 'Insufficient scopes. Required: orders:read'
12+
status: 403
13+
instance: /orders

‎openapi/components/responses/InternalServerError.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ content:
33
application/problem+json:
44
schema:
55
$ref: ../schemas/Error.yaml
6+
examples:
7+
InternalServerError:
8+
summary: Unexpected server error
9+
dataValue:
10+
type: about:blank
11+
title: Internal Server Error
12+
status: 500
13+
instance: /orders
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
description: Menu item not found.
2+
content:
3+
application/problem+json:
4+
schema:
5+
$ref: ../schemas/Error.yaml
6+
examples:
7+
MenuItemNotFound:
8+
summary: No menu item with this ID
9+
dataValue:
10+
type: about:blank
11+
title: Menu item not found
12+
status: 404
13+
instance: /menu/prd_01h1s5z6vf2mm1mz3hevnn9va7

‎openapi/components/responses/NotFound.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ content:
33
application/problem+json:
44
schema:
55
$ref: ../schemas/Error.yaml
6+
examples:
7+
NotFound:
8+
summary: No resource at this path
9+
dataValue:
10+
type: about:blank
11+
title: Cannot GET /.well-known/oauth-authorization-server
12+
status: 404
13+
instance: /.well-known/oauth-authorization-server

‎openapi/components/responses/OAuth2BadRequest.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ content:
55
application/json:
66
schema:
77
$ref: ../schemas/OAuthError.yaml
8+
examples:
9+
InvalidGrant:
10+
summary: Refresh token is invalid or expired
11+
dataValue:
12+
error: invalid_grant
13+
error_description: Invalid refresh token
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description: Invalid client metadata (RFC 7591 Section 3.2.2).
2+
content:
3+
application/json:
4+
schema:
5+
$ref: ../schemas/OAuthError.yaml
6+
examples:
7+
InvalidClientMetadata:
8+
summary: Requested scope does not exist
9+
dataValue:
10+
error: invalid_client_metadata
11+
error_description: "scopes: Invalid enum value. Expected 'menu:read' | 'menu:write' | 'orders:read' | 'orders:write' | 'revenue:read', received 'admin'"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
description: The registration access token is missing or invalid (RFC 7592 Section 2.1).
2+
headers:
3+
WWW-Authenticate:
4+
description: 'Authentication challenge, for example: `Bearer realm="redocly-cafe", error="invalid_token"`.'
5+
schema:
6+
type: string
7+
content:
8+
application/json:
9+
schema:
10+
$ref: ../schemas/OAuthError.yaml
11+
examples:
12+
InvalidToken:
13+
summary: Wrong registration access token
14+
dataValue:
15+
error: invalid_token
16+
error_description: Invalid registration access token

‎openapi/components/responses/OAuth2ServerError.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ content:
33
application/json:
44
schema:
55
$ref: ../schemas/OAuthError.yaml
6+
examples:
7+
ServerError:
8+
summary: Unexpected server error
9+
dataValue:
10+
error: server_error
11+
error_description: An internal error occurred

0 commit comments

Comments
 (0)