fix(schema): apply additive JSON Schema semantics to $ref sibling getters#2921
Conversation
|
I'm not entirely sure the |
…erence-first Per feedback from @handrews on microsoft#2921: additionalProperties and unevaluatedProperties are location-sensitive applicators whose behavior depends on their exact schema location and adjacent keywords. They cannot be safely collapsed into a single effective boolean. Revert both from AND logic back to reference-first convenience accessors, matching the non-lossless keyword bucket.
4428272 to
caff711
Compare
baywet
left a comment
There was a problem hiding this comment.
Thank you for making the changes!
There was a problem hiding this comment.
Pull request overview
Documentation-only update to clarify OpenApiSchemaReference’s contract when accessing JSON Schema keywords alongside $ref, aligning with the discussion in #2919 and preserving the existing “reference-first, then target” convenience getter behavior.
Changes:
- Add XML documentation to
OpenApiSchemaReferenceexplaining that convenience getters return sibling keyword values authored onReferencebefore falling back to resolvedTargetvalues. - Clarify that these getters are object-model conveniences and not JSON Schema evaluation semantics.
Head branch was pushed to by a user without write access
caff711 to
db240a2
Compare
db240a2 to
018c13b
Compare
Summary
Following the discussion in #2919 with @handrews and @baywet, this PR is now documentation-only.
Changes
Adds XML documentation to
OpenApiSchemaReferenceclarifying that convenience getters return authored sibling keyword values fromReferencebefore falling back to resolvedTargetvalues. These getters are object-model conveniences and do not represent JSON Schema evaluation semantics.Rationale
The reference-first getter behavior (
Reference.X ?? Target?.X) was an explicit design decision (#2903). Per #2919:$refare additive in JSON Schema evaluation, not overridesConsumers that need precise JSON Schema semantics should inspect both
ReferenceandTarget, or use a JSON Schema validator.Fixes #2919