-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[Spring] add support for api versioning #22028
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
[Spring] add support for api versioning #22028
Conversation
| operation.vendorExtensions.put("versionQueryParamsList", versionParams); | ||
| } | ||
| if (hasApiVersion) { | ||
| if (!operation.vendorExtensions.remove(VendorExtension.X_SPRING_API_VERSION.getName(), "")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the Pr
quick question: why do you need to remove the extension? wouldn't the next line using putIfAbsent be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal is to remove the version attribute per operation.
For example:
/help:
get:
x-spring-api-version: ''
generates:
@RequestMapping(
method = RequestMethod.GET,
value = TestApi.PATH_GET_HELP
)
I've fixed the implementation and the unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
if no further question/feedback from anyone, i'll merge it later this week
…on: '' is set at the operation level
…APITools#22028) * Add spring api versioning support * Do not add version if not requested * Fix duplicate VendorExtensions * Improve description * Fix removal of RequestMapping version attribute if x-spring-api-version: '' is set at the operation level
Fix #22027 by adding an option version attribute to the
@RequestMappingannotation.Add
springApiVersionconfigOptionAdd
x-spring-api-versionvendorExtensions on operation to override or disable the defaultPR checklist
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.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@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)