OpenAPITools / OpenAPITools/openapi-generator

[REQ] improve php-dt naming of collections

Open
#19,455 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.