- changed status to resolved
Invalid warning in openapi3 when Accept header is defined and mime-types are defined in the spec for different response code
Issue #87
resolved
Given an openapi3 spec with responses for a path like:
...
responses:
'204':
description: Success
'404':
description: Not Found
content:
'application/json':
schema:
type: 'object'
properties:
error:
type: string
And a mock for the 204 response whose requests has an Accept: */*
or Accept: application/json
The validation will output the following warning:
Request Accept header is defined but the spec does not specify any mime-types to produce
Which is invalid since the client can’t know apriori what response status it should get. Instead the accept header should match at least one of the mime-types in any of the responses, regardless what specific response in being mocked.
Comments (1)
-
Account Deactivated reporter - Log in to comment
fix: accept header should match mime-types of any operation responses for openapi 3
Fixes
#87→ <<cset 4f0eb554ff93>>