Repository navigation
feat(common): map the array schema of a content annotation - #17
Merged
Merged
Conversation
The content annotation mapper needs the same handling of minItems, maxItems, uniqueItems and extensions as the collection type resolver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
swagger-core reads @content(array = @ArraySchema(...)) as an array schema, but the library only read Content.schema(), so such a response had no schema. Setting both schema and array fails the spec build, because swagger-core's precedence between them is surprising. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
grubmeshi
force-pushed
the
feature/content-array-schema
branch
from
October 26, 2026 21:57
8a562cf to
6a1018c
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.



@Content(array = @ArraySchema(schema = @Schema(implementation = X.class)))now becomes a media type schematype: arraywithitemsreferencingX, like swagger-core reads it. The outer schema takesminItems,maxItems,uniqueItems,extensionsand thearraySchemaannotation (description, nullable, …).Why: the library only read
Content.schema(). meshfed-api declares its 422 and 500@ApiResponsecontent this way, and those responses had no schema in the spec.A
@Contentthat sets bothschemaandarrayfails the spec build, because swagger-core's precedence between the two is surprising.The first commit moves the handling of the
@ArraySchemafields out ofTypeResolverForCollectionLikeTypeSupportso that both places use it.Tests: a 422 response in app59 (
App59ApiResponseController) andDefaultContentAnnotationMapperTestfor the conflict.🤖 Generated with Claude Code