Skip to content

Commit ec15c2d

Browse files
define defaults for "nodeType" in the XML Object
see https://spec.openapis.org/oas/latest#xml-object
1 parent bbddebb commit ec15c2d

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/schemas/validation/meta.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@ properties:
2121
$ref: '#/$defs/external-docs'
2222
xml:
2323
$ref: '#/$defs/xml'
24+
if:
25+
type: object
26+
required:
27+
- xml
28+
then:
29+
if:
30+
anyOf:
31+
- required:
32+
- $ref
33+
- required:
34+
- $dynamicRef
35+
- required:
36+
- type
37+
properties:
38+
type:
39+
const: array
40+
then:
41+
properties:
42+
xml:
43+
properties:
44+
nodeType:
45+
default: none
46+
else:
47+
properties:
48+
xml:
49+
properties:
50+
nodeType:
51+
default: element
2452

2553
$defs:
2654
discriminator:

tests/schema/pass/media-type-examples.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ paths:
8888
type: object
8989
xml:
9090
nodeType: none
91+
forCoverage:
92+
type: object
93+
$ref: '#/components/schemas/Address'
94+
xml: {}
95+
forCoverage2:
96+
type: object
97+
$dynamicRef: '#/components/schemas/Address'
98+
xml: {}
9199
application/x-www-form-urlencoded:
92100
schema:
93101
type: object

0 commit comments

Comments
 (0)