You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Currently enum values that are the same except for a starting - result in the same const names for php model files. This result in unexecutable files, that need manual editing before it can be used.
openapi-generator version
both on docker:
openapi-generator-cli 5.0.0-SNAPSHOT
commit : a28037d
built : 2020-09-01T09:02:56Z
openapi-generator-cli 5.0.0-beta2
commit : 212b4f7
built : 2020-09-04T05:08:30Z
Run the above command on the spec that is linked in the gist.
Check file src/lib/Model/SalesOrderBillingaddress.php and see duplicate const declaration:
victorlap
changed the title
[BUG] Description
[BUG] [PHP] Enum values starting with - have the same name as ones without, resolving in duplicate consts
Sep 17, 2020
Bug Report Checklist
Description
Currently enum values that are the same except for a starting
-
result in the same const names for php model files. This result in unexecutable files, that need manual editing before it can be used.openapi-generator version
both on docker:
openapi-generator-cli 5.0.0-SNAPSHOT
commit : a28037d
built : 2020-09-01T09:02:56Z
openapi-generator-cli 5.0.0-beta2
commit : 212b4f7
built : 2020-09-04T05:08:30Z
OpenAPI declaration file content or url
https://gist.github.com/victorlap/44e351b72f5d9f26f0ac1943b4c6cf22
Command line used for generation
Steps to reproduce
Run the above command on the spec that is linked in the gist.
Check file
src/lib/Model/SalesOrderBillingaddress.php
and see duplicate const declaration:Related issues/PRs
I've not found any related issues/PRs
Suggest a fix/enhancement
I think the sanitizing of the name needs to change a bit.
It's probably somewhere in the toEnumVarName
The text was updated successfully, but these errors were encountered: