OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Run the above command on the spec that is linked in the gist.
Check file issue7441/src/models/sales_order_billingaddress.rs and see duplicate const declaration:
Bug Report Checklist
Description
openapi-generator version
5.4.0-SNAPSHOT (Git SHA 8a3b434d54de4639295a34c332707678d4f44038)
OpenAPI declaration file content or url
Using code from equivalent bug for PHP: https://github.com/OpenAPITools/openapi-generator/issues/7441
https://gist.github.com/victorlap/44e351b72f5d9f26f0ac1943b4c6cf22
Generation Details
Steps to reproduce
Run the above command on the spec that is linked in the gist. Check file
issue7441/src/models/sales_order_billingaddress.rs
and see duplicate const declaration:Related issues/PRs
PHP: https://github.com/OpenAPITools/openapi-generator/issues/7441
Suggest a fix
This may be a language-independent problem. Adding code at https://github.com/OpenAPITools/openapi-generator/blob/8a3b434d54de4639295a34c332707678d4f44038/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L5914 to check if
toEnumVarName(enumName, dataType)
is present in the name field of an existing entry inenumVars
and adding a disambiguating suffix if so, may work.