Skip to content

Commit d1da6bc

Browse files
tighten up regexes for path items
https://spec.openapis.org/oas/v3.1.0#pathTemplating "The value for these path parameters MUST NOT contain any unescaped “generic syntax” characters described by [[!RFC3986]]: forward slashes (/), question marks (?), or hashes (#)."
1 parent 92df7ca commit d1da6bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

schemas/v3.1/schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
"paths": {
278278
"type": "object",
279279
"patternProperties": {
280-
"^/": {
280+
"^/[^#?]*$": {
281281
"$ref": "#/$defs/path-item"
282282
}
283283
},
@@ -502,6 +502,9 @@
502502
},
503503
"then": {
504504
"properties": {
505+
"name": {
506+
"pattern": "[^/#?]+$"
507+
},
505508
"style": {
506509
"default": "simple",
507510
"enum": [

schemas/v3.1/schema.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ $defs:
191191
paths:
192192
type: object
193193
patternProperties:
194-
'^/':
194+
'^/[^#?]*$':
195195
$ref: '#/$defs/path-item'
196196
$ref: '#/$defs/specification-extensions'
197197
unevaluatedProperties: false
@@ -341,6 +341,8 @@ $defs:
341341
- in
342342
then:
343343
properties:
344+
name:
345+
pattern: '[^/#?]+$'
344346
style:
345347
default: simple
346348
enum:

0 commit comments

Comments
 (0)