You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per documented example and specification responses schema may include a format along with type: 'string'. In this case they're returning a PDF file with a format: 'binary'.
paths:
/report:
get:
summary: Returns the report in the PDF format
responses:
'200':
description: A PDF file
content:
application/pdf:
schema:
type: string
format: binary
The following loop is going through all defined response content-type and picking out only schema.type without any reference to format.
As per documented example and specification responses schema may include a
format
along withtype: 'string'
. In this case they're returning a PDF file with aformat: 'binary'
.https://swagger.io/docs/specification/describing-responses/
https://spec.openapis.org/oas/v3.0.3.html#schema-object
The following loop is going through all defined response
content-type
and picking out onlyschema.type
without any reference toformat
.widdershins/lib/openapi3.js
Lines 446 to 449 in b08e4a3
Subsequently this line then stomps on anything set above when not either
array
orobject
.widdershins/lib/openapi3.js
Lines 455 to 459 in b08e4a3
The resulting output from
getResponses
thus completely misinterprets the type of response.Expected behavior
Output multiple response content-type's with the correct schema.
#436
Versions:
The text was updated successfully, but these errors were encountered: