OpenAPITools / OpenAPITools/openapi-generator
[REQ] improve php-dt naming of collections
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
The php-dt generator creates Collection objects with generated unique names. See: PhpDataTransferClientCodegen.java#L435
This will yield a lot of CollectionXX classes, including uniquely named ones that have the exact same purpose/contents.
Would it be possible to change the schema name to just use the type of the items in the container? That way the generated code could have collections like "StringCollection", "UserCollection" or any other "ModelCollection".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpDataTransferClientCodegen.java around line 435, where collection names are generated. Trace the php-dt generation path and existing tests, then verify that collections are named from their item type, such as StringCollection or UserCollection, without redundant uniquely named equivalents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100