Skip to content

Commit 9cf8ec8

Browse files
Disallow fragments in uri-references that point elsewhere in the OpenAPI description
1 parent 9fd4e2e commit 9cf8ec8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

schemas/v3.1/schema.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ properties:
1111
info:
1212
$ref: '#/$defs/info'
1313
jsonSchemaDialect:
14-
type: string
15-
format: uri-reference
14+
$ref: '#/$defs/uri-reference-no-fragment'
1615
default: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
1716
servers:
1817
type: array
@@ -214,8 +213,7 @@ $defs:
214213
type: object
215214
properties:
216215
$ref:
217-
type: string
218-
format: uri-reference
216+
$ref: '#/$defs/uri-reference-no-fragment'
219217
summary:
220218
type: string
221219
description:
@@ -621,8 +619,7 @@ $defs:
621619
type: object
622620
properties:
623621
operationRef:
624-
type: string
625-
format: uri-reference
622+
$ref: '#/$defs/uri-reference-no-fragment'
626623
operationId:
627624
type: string
628625
parameters:
@@ -716,8 +713,7 @@ $defs:
716713
type: object
717714
properties:
718715
$ref:
719-
type: string
720-
format: uri-reference
716+
$ref: '#/$defs/uri-reference-no-fragment'
721717
summary:
722718
type: string
723719
description:
@@ -972,3 +968,9 @@ $defs:
972968
properties:
973969
explode:
974970
default: false
971+
972+
uri-reference-no-fragment:
973+
$comment: a uri-reference used to reference other parts of the OpenAPI description
974+
type: string
975+
format: uri-reference
976+
regex: '^[^#]*$'

0 commit comments

Comments
 (0)