Skip to content

Conversation

@wing328
Copy link
Member

@wing328 wing328 commented Feb 19, 2021

  • Fix bugs to ensure unique parameter names
  • Add tests

Related: #5963

Credit: @thiagoarrais for creating the test spec.

cc @OpenAPITools/generator-core-team

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328 wing328 added this to the 5.1.0 milestone Feb 19, 2021
@wing328 wing328 changed the title Fix ensure unique parameters Fix bugs to ensure unique parameter names Feb 19, 2021
@thiagoarrais
Copy link
Contributor

Quick review: as I understand, this deduplicates parameter names by adding a numerical suffix. While this is useful for stopping compilers from complaining, I think it may be confusing for the programmers using generated clients.

Would you be interested in a PR that namespaces the parameteres to their request location (cp.paramName == "queryId", cp2.paramName == "formId", etc.) when needed? This would work much like #5963, but not limited to an specific generator.

@wing328
Copy link
Member Author

wing328 commented Feb 23, 2021

@thiagoarrais thanks for the review. Also thanks for the PR to start the work on this. Much appreciated.

Would you be interested in a PR that namespaces the parameteres to their request location (cp.paramName == "queryId", cp2.paramName == "formId", etc.

General speaking we totally welcome enhancements. For this particular case, the PR may need to target 6.0x branch as it's a breaking changes without fallback given that the duplicated parameter names will have a better naming using the request location.

Please open a PR for 6.0.x and we'll review and get it merged accordingly.

@wing328 wing328 merged commit 42d3dbd into master Feb 23, 2021
@wing328 wing328 deleted the fix_ensure_unique branch February 23, 2021 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants