fix: OpenAPI generation when default API version absent from header allowableValues - #3356
Open
arimu1 wants to merge 1 commit into
Open
fix: OpenAPI generation when default API version absent from header allowableValues#3356arimu1 wants to merge 1 commit into
arimu1 wants to merge 1 commit into
Conversation
Copy annotation-derived header enum values into a mutable list before merging MVC version metadata, and skip appending the global default when allowableValues already restrict the schema. Fixes springdoc#3354
arimu1
force-pushed
the
fix/3354-api-version-header-enum
branch
from
September 12, 2026 13:03
99fdd42 to
df239e7
Compare
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
/v3/api-docswhen Spring MVC header API versioning defines a global default that is not listed in an operation's@Schema(allowableValues)for the version header parameter.allowableValuesalready define a non-empty enum (preserves operation-specific supported versions).Fixes #3354
Test plan
mvn -pl springdoc-openapi-starter-webmvc-api -am test -Dtest=SpringDocApp3354Test -Dsurefire.failIfNoSpecifiedTests=false(Java 21)mvn -pl springdoc-openapi-starter-webmvc-api -am test -Dtest=SpringDocApp250Test -Dsurefire.failIfNoSpecifiedTests=false(regression for header API versioning)