Skip to content

[Java][Spring] Fix formParams template to add support for default values when generating @RequestParam annotation for parameters included in a body with content: application/x-www-form-urlencoded#20314

Open
JoseLora wants to merge 6 commits into
OpenAPITools:masterfrom
JoseLora:bugfix/fix-formparams-defaultvalue
Open

Conversation

@JoseLora

@JoseLora JoseLora commented Dec 13, 2024

Copy link
Copy Markdown

formParams.mustache template is lacking support for default values when generating @RequestParam annotation for parameters included in a body with content: application/x-www-form-urlencoded. This PR adds support for default values just the same way queryParams.mustache already has.

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 || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    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*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@JoseLora

Copy link
Copy Markdown
Author

@borsch @welshm @wing328 Could you review this please? Thanks

@wing328

wing328 commented Jan 5, 2025

Copy link
Copy Markdown
Member

thanks for the PR

cc @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08)

@wing328

wing328 commented Jan 5, 2025

Copy link
Copy Markdown
Member

please merge the latest master into your branch to resolve https://github.com/OpenAPITools/openapi-generator/actions/runs/12314784957/job/35166807799?pr=20314

@wing328

wing328 commented Jan 5, 2025

Copy link
Copy Markdown
Member

@JoseLora

Copy link
Copy Markdown
Author

Hi @wing328

Sorry for the delay. I think it is all OK now.

Thanks

@JoseLora JoseLora requested a review from martin-mfg April 10, 2025 15:41
@jorgerod

Copy link
Copy Markdown
Contributor

Hi @martin-mfg @wing328

Can it be merged now? The conflicts have been resolved.

@wing328

wing328 commented Jul 31, 2025

Copy link
Copy Markdown
Member

please resolve the merge conflicts when you've time

@wing328 wing328 added this to the 7.15.0 milestone Jul 31, 2025
@wing328 wing328 modified the milestones: 7.15.0, 7.16.0 Aug 22, 2025
@wing328 wing328 modified the milestones: 7.16.0, 8.0.0, 7.17.0 Sep 28, 2025
@JoseLora

JoseLora commented Oct 7, 2025

Copy link
Copy Markdown
Author

@wing328 done!

@JoseLora JoseLora requested a review from martin-mfg October 13, 2025 01:18
@wing328

wing328 commented Oct 29, 2025

Copy link
Copy Markdown
Member

tests failed with updated samples via PR: #22245

https://github.com/OpenAPITools/openapi-generator/actions/runs/18904638855/job/53959854770?pr=22245

can you please review the build failure when you've time?

@wing328 wing328 removed this from the 7.17.0 milestone Oct 29, 2025
@wing328 wing328 added this to the 7.18.0 milestone Oct 29, 2025
@wing328 wing328 modified the milestones: 7.18.0, 7.19.0 Dec 22, 2025
@wing328 wing328 modified the milestones: 7.19.0, 7.20.0 Jan 19, 2026
@wing328 wing328 modified the milestones: 7.20.0, 7.21.0 Feb 16, 2026
@wing328 wing328 modified the milestones: 7.21.0, 7.22.0 Mar 24, 2026
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.

4 participants