Open Saljack opened 1 year ago
Fixed it here: https://github.com/micronaut-projects/micronaut-openapi/pull/1735
Just use official micronaut generator for java and kotlin by micronaut-opeanpi gradle or maven plugin from this repo: https://github.com/micronaut-projects/micronaut-openapi
Look to this guide: https://guides.micronaut.io/latest/micronaut-openapi-generator-server.html
Also, please describe problems and suggestions here: https://github.com/micronaut-projects/micronaut-openapi/issues
Bug Report Checklist
Description
Because
file
is reserved word (see AbstractJavaCodegen.java#L180) inAbstractJavaCodegen
so it is replaced/escaped with_file
. Therefore if you use a property inmultipar/form-data
with a namefile
it is generated injava-micronaut-server
as a parameterCompletedFileUpload _file
and Micronaut it as the multipart name. It does not work if you send a request with the namefile
and the parameter is alwaysnull
. If you send the same requests but change the name to_file
it works. But it does not match to OpenaAPI.openapi-generator version
I use the latest version OpenAPI Generator with maven plugin v6.6.0. I also tried master branch.
OpenAPI declaration
I have this request body definition:
Generated Code
Steps to reproduce
file
java-micronaut-server
file
and it failsSuggest a fix
Add
@Part("file")
annotation to_file
parameter.