Repository navigation
Conversation
| * @author 6londe | ||
| */ | ||
| @ContextConfiguration(classes = ImplicitProducesApiVersionTest.TestApplication.class) | ||
| class ImplicitProducesApiVersionTest extends AbstractCommonTest { |
Contributor
There was a problem hiding this comment.
To me it looks like the placement of this test does not align with any pattern used in any other test suite in this repo? Is this intentional?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With media-type API versioning, Spring can select different handlers for the same route when
producesis inherited from the controller or omitted. The generated response under/v3/api-docscurrently combines the schemas under an unversioned content key, even though requests with different version parameters select different handlers.Apply the version parameter to compatible inherited or default response media types. Preserve existing media-type parameters and the method-level
producesbehavior. Leave incompatible and negated expressions intact.Verification
mainwith the regression tests applied, the two OpenAPI assertions failed and the other 16 tests passed. After the fix, all 18 passed../mvnw -s <settings> -B -ntp -pl springdoc-openapi-starter-webmvc-api -am test -Dtest=ImplicitProducesApiVersionTest,SpringDocApp248Test,MethodAttributesTest -Dsurefire.failIfNoSpecifiedTests=false../mvnw -s <settings> -B -ntp -pl springdoc-openapi-starter-webmvc-api,springdoc-openapi-starter-webflux-api -am test. All 907 tests passed.Local verification used JDK 21 and Maven settings that mirror the configured Spring repositories to Maven Central. Swagger UI rendering was outside the verification scope.
AI disclosure: Codex prepared and validated the change under the contributor's standing authorization.