swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
I am trying to generate code (models and apis) from swagger definition responses. For compatibility reasons we have a defined one attribute twice but technically the key is different.
Description
I am trying to generate code (models and apis) from swagger definition responses. For compatibility reasons we have a defined one attribute twice but technically the key is different.
See following response.
{ "**accessToken**": "<TOKEN>, "**access_token**": "<TOKEN>", "user": { "id": "23444", "firstName": "Test", "lastName": "De", "primaryEmailAddress": "example@gmail.com", "emailAddresses": [ { "address": "example@gmail.com" } ],
When code is generated using swagger-codegen then underscore is replaces and attribute is generated twice, see following model snippet
Swagger-codegen version
2.3.0-SNAPSHOT (build locally based on master branch)
Swagger declaration file content or url
for security reasons I can not share exact code. But if needed I will create a sample
Swagger declaration file content or url
I am using swagger code generator from within Java code. I found an option to tell MODEL_PROPERTY_NAMING but it didn't work.
See following code
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
When attributes are defined with different conventions, for whatever reason, it should be respected. Don't replace underscore in variables.