Skip to content

Commit 18ee9f0

Browse files
committed
Fix 3.1 Path Item schema
Path Item Objects allow "$ref", and despite the syntactic overlap, it is neither accurate nor semantically meaningful to parse a Path Item Object as a Reference Object, even if such parsing would be successful.
1 parent 9dff244 commit 18ee9f0

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

schemas/v3.1/schema.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ properties:
2525
webhooks:
2626
type: object
2727
additionalProperties:
28-
$ref: '#/$defs/path-item-or-reference'
28+
$ref: '#/$defs/path-item'
2929
components:
3030
$ref: '#/$defs/components'
3131
security:
@@ -192,7 +192,7 @@ $defs:
192192
pathItems:
193193
type: object
194194
additionalProperties:
195-
$ref: '#/$defs/path-item-or-reference'
195+
$ref: '#/$defs/path-item'
196196
patternProperties:
197197
'^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
198198
$comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected
@@ -214,6 +214,9 @@ $defs:
214214
$comment: https://spec.openapis.org/oas/v3.1.0#path-item-object
215215
type: object
216216
properties:
217+
$ref:
218+
type: string
219+
format: uri-reference
217220
summary:
218221
type: string
219222
description:
@@ -245,16 +248,6 @@ $defs:
245248
$ref: '#/$defs/specification-extensions'
246249
unevaluatedProperties: false
247250

248-
path-item-or-reference:
249-
if:
250-
type: object
251-
required:
252-
- $ref
253-
then:
254-
$ref: '#/$defs/reference'
255-
else:
256-
$ref: '#/$defs/path-item'
257-
258251
operation:
259252
$comment: https://spec.openapis.org/oas/v3.1.0#operation-object
260253
type: object
@@ -617,7 +610,7 @@ $defs:
617610
type: object
618611
$ref: '#/$defs/specification-extensions'
619612
additionalProperties:
620-
$ref: '#/$defs/path-item-or-reference'
613+
$ref: '#/$defs/path-item'
621614

622615
callbacks-or-reference:
623616
if:

0 commit comments

Comments
 (0)