[BUG] Codegen isMultipart always false
Created by: ybelenko
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
Codegen isMultipart
property is always false
even when multipart/form-data
in consumes
array.
Related codegen part:
{
"responseHeaders": [],
"hasAuthMethods": true,
"hasConsumes": true,
"hasProduces": true,
"hasParams": true,
"hasOptionalParams": true,
"hasRequiredParams": true,
"returnTypeIsPrimitive": false,
"returnSimpleType": true,
"subresourceOperation": false,
"isMapContainer": false,
"isListContainer": false,
"isMultipart": false,
"hasMore": false,
"isResponseBinary": false,
"isResponseFile": false,
"hasReference": true,
"isRestfulIndex": false,
"isRestfulShow": false,
"isRestfulCreate": false,
"isRestfulUpdate": false,
"isRestfulDestroy": false,
"isRestful": false,
"isDeprecated": false,
"isCallbackRequest": false,
"path": "/fake/{petId}/uploadImageWithRequiredFile",
"operationId": "uploadFileWithRequiredFile",
"returnType": "\\OpenAPIServer\\Model\\ApiResponse",
"httpMethod": "POST",
"returnBaseType": "ApiResponse",
"summary": "uploads an image (required)",
"baseName": "Pet",
"consumes": [
{
"mediaType": "multipart/form-data"
}
]
}
openapi-generator version
4.1.1
OpenAPI declaration file content or url
petstore-with-fake-endpoints-models-for-testing.yaml
Command line used for generation
Build any SDK as usual with -DdebugOperations
option.
$ java -jar ./modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -DdebugOperations -t modules/openapi-generator/src/main/resources/php-slim-server -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim
Steps to reproduce
Generate any language library with -DdebugOperations
option. Check operation uploadFileWithRequiredFile
output.