swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
If you use --type-mappings Pet=MyPet to generate the java source code, the type Pet is no replaced with MyPet in operation parameters. It works correctly in return values and references between model objects.
Swagger-codegen version
I tried this in swagger-codegen-generators master as of Sat May 2, 2020, and also in codegen maven plugin 3.0.8 and 3.0.19.
Description
If you use --type-mappings Pet=MyPet to generate the java source code, the type Pet is no replaced with MyPet in operation parameters. It works correctly in return values and references between model objects.
Swagger-codegen version
I tried this in swagger-codegen-generators master as of Sat May 2, 2020, and also in codegen maven plugin 3.0.8 and 3.0.19.
Swagger declaration file content or url
Command line used for generation
The arguments used to the command line client:
Steps to reproduce
You will notice in the generated PetApiController class the following operation:
.... }
The return value is as expected, a MyPet, but the parameter is Pet instead of MyPet.
Related issues/PRs
Could not find any.
Suggest a fix/enhancement
I fixed it locally for this case with:
As you can see, I just copied the logic from the operation:
I don't know if this is the correct fix.