Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ rules:
- application/octet-stream

must-return-content-types:
description: "All endpoint bodies MUST return the header with (one of) Content-Type: application/json, image/png, application/octet-stream."
description: "Endpoint bodies for 200 responses MUST return the header with (one of) Content-Type: application/json, image/png, application/octet-stream."
message: "{{description}}"
severity: warn
given: $.paths[*].*.responses.*.content
given: $.paths[*].*.responses['200'].content
then:
field: "@key"
function: enumeration
Expand Down
8 changes: 7 additions & 1 deletion TestSpecs/must-return-content-types-valid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ paths:
maxLength: 200
minLength: 1
type: string
additionalProperties: false
additionalProperties: false
'400':
description: Bad request
content:
text/plain:
schema:
type: string