From da20963f1a96fae5f15013f1ce9fc9f03d196741 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Wed, 9 Sep 2026 10:34:50 -0700 Subject: [PATCH] define defaults for "nodeType" in the XML Object see https://spec.openapis.org/oas/latest#xml-object --- src/schemas/validation/meta.yaml | 28 ++++++++++++++++++++++ tests/schema/pass/media-type-examples.yaml | 9 +++++++ 2 files changed, 37 insertions(+) diff --git a/src/schemas/validation/meta.yaml b/src/schemas/validation/meta.yaml index 1de81e024e..c357390763 100644 --- a/src/schemas/validation/meta.yaml +++ b/src/schemas/validation/meta.yaml @@ -21,6 +21,34 @@ properties: $ref: '#/$defs/external-docs' xml: $ref: '#/$defs/xml' +if: + type: object + required: + - xml +then: + if: + anyOf: + - required: + - $ref + - required: + - $dynamicRef + - required: + - type + properties: + type: + const: array + then: + properties: + xml: + properties: + nodeType: + default: none + else: + properties: + xml: + properties: + nodeType: + default: element $defs: discriminator: diff --git a/tests/schema/pass/media-type-examples.yaml b/tests/schema/pass/media-type-examples.yaml index 0d810fd0ba..cde9f2e0e5 100644 --- a/tests/schema/pass/media-type-examples.yaml +++ b/tests/schema/pass/media-type-examples.yaml @@ -88,6 +88,15 @@ paths: type: object xml: nodeType: none + forCoverage: + type: object + $ref: '#/components/schemas/Address' + xml: {} + forCoverage2: + type: object + $dynamicRef: '#/components/schemas/Address' + xml: {} + forCoverage3: true application/x-www-form-urlencoded: schema: type: object