Skip to content

Preserve @ArraySchema item metadata when implementation is used#5054

Closed
Neo1228 wants to merge 1 commit intoswagger-api:masterfrom
Neo1228:fix/5051-response-array-item-schema
Closed

Preserve @ArraySchema item metadata when implementation is used#5054
Neo1228 wants to merge 1 commit intoswagger-api:masterfrom
Neo1228:fix/5051-response-array-item-schema

Conversation

@Neo1228
Copy link
Copy Markdown

@Neo1228 Neo1228 commented Feb 14, 2026

Summary

  • add a jaxrs2 regression resource/test that reproduces item-level metadata loss when using @Content(array=@ArraySchema(...)) with schema(implementation=...)
  • preserve item-level annotation attributes (description, format, access mode, etc.) by merging array.schema() into a detached item schema when implementation-based item schema is resolved
  • keep array-level metadata on the array schema while correctly applying item-level metadata to items

Why

  • @ArraySchema.schema(implementation=...) produced the correct item type but dropped item-level schema annotation metadata in generated OpenAPI
  • this change keeps the implementation-based item type and applies the additional item constraints/metadata as expected

Tests

  • mvn -pl modules/swagger-jaxrs2 "-Dtest=io.swagger.v3.jaxrs2.ReaderTest#test5051ResponseArraySchemaDescriptionLeak" test
  • mvn test -pl modules/swagger-jaxrs2
  • mvn test -pl modules/swagger-core

@Neo1228 Neo1228 closed this by deleting the head repository Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant