Lock OAS 3.1 type deserializer behavior and drop a dead null check - #2
Draft
jaipilot[bot] wants to merge 1 commit into
Draft
Conversation
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.
Companion improvement for the JAIPilot Cloud mirror of swagger-api#5266 (exact head 3ee7d00).
What the original PR does: adds Schema31Mixin.TypeDeserializer, the inverse of the existing TypeSerializer, so an OAS 3.1 'type' property serialized as a scalar string or a string array can be read back into the model's Set types field; wires it via @JsonDeserialize on Schema31Mixin.getTypes() and on GenericOpenApiContext.SortedSchemaMixin31.getTypes() (which reuses the same TypeDeserializer class rather than duplicating it); and adds JsonSchemaTypeRoundTripTest and SortedSchemaMixin31TypeRoundTripTest to prove the round trip.
What this companion adds on top, without changing any observable behavior:
Verification: focused JsonSchemaTypeRoundTripTest and SortedSchemaMixin31TypeRoundTripTest pass identically before and after the edit; the full swagger-core (771 tests) and swagger-integration (3 tests) suites pass clean on the final candidate.
Limitations: performance was not benchmarked because the change is not on a measurable hot path (deterministic, non-looping allocation); no build/dependency file was touched so modernization was out of scope for this PR's changed paths.
Generated by JAIPilot Cloud for #1 from Anthropic session
sesn_01HyJAA8Nve7VizsrfD6wxAR.