Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for multible tags in @Operation annotation #11475

Merged
merged 7 commits into from
Feb 10, 2022

Conversation

ugrave
Copy link
Contributor

@ugrave ugrave commented Feb 1, 2022

This PR fixed #11464.

If multble tags are defined the spring generator (with swagger2 annotations) insert a tag attribute for each tag which is defined in the spec.

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.3.0), 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.
    @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)

@cachescrubber
Copy link
Contributor

@ugrave Thanks for your contribution. Could you update the swagger1 @ApiOperation as well? Otherwise, the PR looks good.

@welshm, @wing328 FYI.

application/json:
schema:
type: string
/multible:
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to fix the typo - multiple - so that any future reader doesn't need to be unsure of the typo

@ugrave
Copy link
Contributor Author

ugrave commented Feb 2, 2022

@ugrave Thanks for your contribution. Could you update the swagger1 @ApiOperation as well? Otherwise, the PR looks good.

@welshm, @wing328 FYI.

Changed also the @ApiOperation.
Note that the tag attribute is know only added if any tag is set.
Before the tag attribute was always there. If no attribute was given an empy value was set (tag = {})

@tofi86
Copy link

tofi86 commented Feb 9, 2022

@wing328 issue #11464 happens for me when switching from 5.3.x to 5.4.0 and when using the new osa3 flag introduced with #9775 in 5.3.1. Any chance to get this fix into 5.4.x instead of 6.0.0 milestone?

@wing328
Copy link
Member

wing328 commented Feb 10, 2022

Tested with updated samples and the result is good:

[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ spring-cloud-date-time ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ spring-cloud-date-time ---
[INFO] Building jar: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/spring-cloud-date-time/target/spring-cloud-date-time-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.426 s
[INFO] Finished at: 2022-02-10T14:43:23+08:00
[INFO] ------------------------------------------------------------------------

@wing328 wing328 merged commit bd48108 into OpenAPITools:master Feb 10, 2022
@wing328
Copy link
Member

wing328 commented Feb 10, 2022

Samples updated via 376bf6c

@ugrave ugrave deleted the fix_issue11464 branch February 10, 2022 08:43
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.

[BUG][SPRING] Generates mutlible tags in Operation annotation if more then one tag is defined.
5 participants