Bug Report Checklist
Description
Invalid Typescript code is generated for Form Data Parameters that have an Object Type.
openapi-generator version
OpenAPI Generator Version 7.14.0
OpenAPI declaration file content or url
Example OpenAPI spec portion for path that reproduces this issue:
put:
description: A description
operationId: doOperation
requestBody:
content:
multipart/form-data:
schema:
properties:
stringProp:
description: This is our string
type: string
samlConfiguration:
$ref: '#/components/schemas/ANOtherObject'
type: object
Generation Details
Generating code using:
java -jar openapi-generator-cli.jar generate -g typescript-fetch -i openapi.yaml
The generated API TS files has this line:
if (requestParameters['samlConfiguration'] != null) {
formParams.append('samlConfiguration', new Blob([JSON.stringify(ToJSON(requestParameters['samlConfiguration']))], { type: "application/json", }));
}
Which fails to compile as ToJSON should be ApiSamlConfigurationDTOToJSON.
Suggest a fix
I will supply a PR shortly to address this issue.
Bug Report Checklist
Description
Invalid Typescript code is generated for Form Data Parameters that have an Object Type.
openapi-generator version
OpenAPI Generator Version 7.14.0
OpenAPI declaration file content or url
Example OpenAPI spec portion for path that reproduces this issue:
Generation Details
Generating code using:
The generated API TS files has this line:
Which fails to compile as
ToJSONshould beApiSamlConfigurationDTOToJSON.Suggest a fix
I will supply a PR shortly to address this issue.