Skip to content

[Java][Spring] fix default response code#14399

Merged
wing328 merged 1 commit into
OpenAPITools:masterfrom
borsch:spring-default-response
Jan 11, 2023
Merged

[Java][Spring] fix default response code#14399
wing328 merged 1 commit into
OpenAPITools:masterfrom
borsch:spring-default-response

Conversation

@borsch
Copy link
Copy Markdown
Member

@borsch borsch commented Jan 7, 2023

fix for #14394

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 (6.3.0) (minor release - breaking changes with fallbacks), 7.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.

@borsch
Copy link
Copy Markdown
Member Author

borsch commented Jan 7, 2023

@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)

@GregDThomas
Copy link
Copy Markdown
Contributor

Wow - thank you! Just logged in to see how easy this would be to fix - and you've already done it :)

responses = {
{{#responses}}
@ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = {
@ApiResponse(responseCode = {{#isDefault}}"default"{{/isDefault}}{{^isDefault}}"{{{code}}}"{{/isDefault}}, description = "{{{message}}}"{{#baseType}}, content = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change looks great! Should there be a unit test for this? I'm also happy to add it if you think it adds value

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, samples are updated. do you think we still need unit test for this? If yes I can add them quickly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry missed this. I do think unit tests still add value because if someone breaks it, the unit tests will block the submission (hopefully) or alert them that the samples were updated incorrectly. I can add these in a few days and send out for review

@borsch
Copy link
Copy Markdown
Member Author

borsch commented Jan 11, 2023

@wing328 could you please review?

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