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
When in an OpenAPIv2 file, an operation contains a parameter in: formData that has an array schema and the request's body is specified to have Content-Type: multipart/form-data, the Mermade produced OpenAPIv3 equivalent ignores the collectionFormat property. It has been stated in
Until this is fixed, the Mermade converter should signal an error "don't know how to convert in:formData parameter with array schema in Content-Type: multipart/form-data".
Checklist
Conversion: I have checked my source definition is valid OpenAPI 2.0
Conversion: On valid OpenAPI 2.0 input, the conversion looks wrong
Detailed Description
Assume an operation with Content-Type: multipart/form-data.
In OpenAPIv2 the serialization of parameters that have an array schema is guided by the collectionFormat property.
In particular, the serialization is specified through an encoding object outside the schema object, but in this object the properties style and explode are ignored for Content-Type: multipart/form-data.
$ swagger2openapi -o form-multipart-parameter-array-of-strings-ssv.v3m.json form-multipart-parameter-array-of-strings-ssv.v2.json
{ S2OError: collectionFormat:ssv is no longer supported except for in:query parameters
at throwError (/openapi/node_modules/swagger2openapi/index.js:39:15)
at throwOrWarn (/openapi/node_modules/swagger2openapi/index.js:54:9)
at processParameter (/openapi/node_modules/swagger2openapi/index.js:564:21)
at processPaths (/openapi/node_modules/swagger2openapi/index.js:936:30)
at main (/openapi/node_modules/swagger2openapi/index.js:1170:5)
at /openapi/node_modules/swagger2openapi/index.js:1505:13 name: 'S2OError' }
$ swagger2openapi -o form-multipart-parameter-array-of-strings-pipes.v3m.json form-multipart-parameter-array-of-strings-pipes.v2.json
{ S2OError: collectionFormat:pipes is no longer supported except for in:query parameters
at throwError (/openapi/node_modules/swagger2openapi/index.js:39:15)
at throwOrWarn (/openapi/node_modules/swagger2openapi/index.js:54:9)
at processParameter (/openapi/node_modules/swagger2openapi/index.js:572:21)
at processPaths (/openapi/node_modules/swagger2openapi/index.js:936:30)
at main (/openapi/node_modules/swagger2openapi/index.js:1170:5)
at /openapi/node_modules/swagger2openapi/index.js:1505:13 name: 'S2OError' }
When in an OpenAPIv2 file, an operation contains a parameter
in: formData
that has an array schema and the request's body is specified to haveContent-Type: multipart/form-data
, the Mermade produced OpenAPIv3 equivalent ignores thecollectionFormat
property. It has been stated inthat the OpenAPIv3 spec is not clear about which serialization is used for such parameters.
Until this is fixed, the Mermade converter should signal an error "don't know how to convert in:formData parameter with array schema in Content-Type: multipart/form-data".
Checklist
Detailed Description
Assume an operation with
Content-Type: multipart/form-data
.In OpenAPIv2 the serialization of parameters that have an array schema is guided by the
collectionFormat
property.In OpenAPIv3, on the other hand, such parameters are first-level properties in the schema of the mediaType of the content of the requestBody.
The important sections here in the OpenAPIv3 spec https://github.com/OAI/OpenAPI-Specification/blob/676b48d8385244d5b02a9cfe40059d4a41f329cc/versions/3.0.2.md are:
multipart
ContentIn particular, the serialization is specified through an
encoding
object outside theschema
object, but in this object the propertiesstyle
andexplode
are ignored forContent-Type: multipart/form-data
.I have prepared 4 test cases.
All should provide the same error message.
Other stuff
Version: swagger2openapi-5.3.0
form-multipart-parameter-array-of-strings-csv.v2.json.gz
form-multipart-parameter-array-of-strings-ssv.v2.json.gz
form-multipart-parameter-array-of-strings-pipes.v2.json.gz
form-multipart-parameter-array-of-strings-multi.v2.json.gz
The text was updated successfully, but these errors were encountered: