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
Describe the bug
When parsing OpenAPI 2.0 specifications containing parameters with type: file, the library (2.0.0-preview.16) converts these to string type without setting format: binary. In my expectation, when viewing OpenAPI 3.x examples, the old file type should be parsed as string with binary format.
We can take a look at /uploadImage service from petStore example
there is a file parameter of type file
"/pet/{petId}/uploadImage": {
"post": {
"tags": [ "pet" ],
"summary": "uploads an image",
"description": "",
"operationId": "uploadFile",
"consumes": [ "multipart/form-data" ],
"produces": [ "application/json" ],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet to update",
"required": true,
"type": "integer",
"format": "int64"
},
{
"name": "additionalMetadata",
"in": "formData",
"description": "Additional data to pass to server",
"required": false,
"type": "string"
},
{
"name": "file",
"in": "formData",
"description": "file to upload",
"required": false,
"type": "file"
}
],
But after debugging, i found this parameter is parsed to string type with format = null.
I didn't find another usable property in schemas to detect it's binary file and not a string.
Describe the bug
When parsing OpenAPI 2.0 specifications containing parameters with
type: file
, the library (2.0.0-preview.16
) converts these tostring
type without settingformat: binary
. In my expectation, when viewing OpenAPI 3.x examples, the oldfile
type should be parsed asstring
withbinary
format.We can take a look at
/uploadImage
service frompetStore
examplethere is a file parameter of type
file
But after debugging, i found this parameter is parsed to
string
type with format =null
.I didn't find another usable property in schemas to detect it's binary file and not a string.
OpenApi File To Reproduce
/pet/{petId}/uploadImage
operationfile
parameter is parsed as:type = "string",
format = null // -> Expected Format = "binary"
Expected behavior
Parameters with
type: file
in OpenAPI 2.0 should be parsed as:type = "string",
format = "binary"
Screenshots/Code Snippets
Additional context
type
withstring + binary
format (spec reference: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#considerations-for-file-uploads)The text was updated successfully, but these errors were encountered: