Skip to content

Commit

Permalink
add "compression required" problem for verbose GETs
Browse files Browse the repository at this point in the history
  • Loading branch information
catkins-miso committed Nov 15, 2024
1 parent 6166f96 commit 948f416
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/_spec/openapi-split.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ components:
<<: *rate-limited
description: Not Found
content: *empty
'406-empty':
'406-problem':
<<: *rate-limited
description: Not Acceptable (Content negotiation failed)
content: *problem
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/limits_forecast-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ current:
'404':
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406':
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: 'limits_realtime-snapshot.yaml#/global/get/responses/406'
'429':
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
13 changes: 12 additions & 1 deletion docs/_spec/paths/limits_realtime-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@ global:
'404':
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406':
$ref: '../openapi-split.yaml#/components/responses/406-empty'
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'
description: Not Acceptable (Content negotiation failed)
content:
"application/problem+json":
schema:
$ref: '../openapi-split.yaml#/components/schemas/problem'
examples:
"Compression Required":
summary: Only compressed responses are supported
value:
$ref: '../../articles/examples/compression-required.json'
'429':
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/monitoring-sets_{id}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ get:
'404':
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406':
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429':
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/rating-proposals_forecasts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ get: &get
'403': &forbidden-empty
$ref: '../openapi-split.yaml#/components/responses/403-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/rating-proposals_realtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ get:
'403': &forbidden-empty
$ref: '../openapi-split.yaml#/components/responses/403-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/rating-proposals_seasonal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ get: &get
'403': &forbidden-empty
$ref: '../openapi-split.yaml#/components/responses/403-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/seasonal-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ get:
'404': &not-found-empty
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/seasonal-overrides_{id}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ get:
'404': &not-found-empty
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'410':
$ref: '../openapi-split.yaml#/components/responses/410-problem'
'429': &rate-limit-hit
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/seasonal-ratings-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ get:
'404':
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406':
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: 'limits_realtime-snapshot.yaml#/global/get/responses/406'
'429':
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/temporary-aar-exceptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ get:
'404': &not-found-empty
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
Expand Down
2 changes: 1 addition & 1 deletion docs/_spec/paths/temporary-aar-exceptions_{id}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ get:
'404': &not-found-empty
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
$ref: '../openapi-split.yaml#/components/responses/406-problem'
'410':
$ref: '../openapi-split.yaml#/components/responses/410-problem'
'429': &rate-limit-hit
Expand Down
6 changes: 6 additions & 0 deletions docs/articles/examples/compression-required.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "//trolie.example.com/spec/client-errors/406/compression-required",
"title": "Not Acceptable: Accept-Encoding Required",
"status": 406,
"detail": "This resource must be compressed with one of the following algorithms: gzip, deflate, br."
}

0 comments on commit 948f416

Please sign in to comment.