Skip to content

Commit fdd18b0

Browse files
apply the ABNF for path parameter names, OAS 3.2.0 §4.8.2
Header parameter names have already been adjusted. The ABNF for the query component of URIs is at RFC3986 §3.4, but percent-encoding is used, which allows for the use of any character. Additionally, cookies using style=form are also percent-encoded and therefore allow any character. Moreover, cookie parameter names are percent-encoded when using style=form, and even for style=cookie they are not used in serialization of objects when explode=true, so a restriction on cookie parameter names is not added here; however applications should apply their own restrictions, following the "cookie-name" and "cookie-value" ABNFs at RFC6265 §4.1.1 (and ensure that all disallowed characters are percent-encoded when using style=form).
1 parent 8c0f752 commit fdd18b0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/schemas/validation/schema.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,23 @@ $defs:
414414
then:
415415
required:
416416
- content
417+
- if:
418+
properties:
419+
in:
420+
const: path
421+
then:
422+
properties:
423+
name:
424+
$comment: 'see OAS 3.2.0 §4.8.2'
425+
pattern: '^[^{}]+$'
417426
- if:
418427
properties:
419428
in:
420429
const: header
421430
then:
422431
properties:
423432
name:
433+
$comment: 'see RFC9110 §5.1'
424434
$ref: '#/$defs/token'
425435
dependentSchemas:
426436
schema:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.2.0
2+
info:
3+
title: path parameter name has a constrained syntax
4+
version: 1.0.0
5+
components:
6+
parameters:
7+
BadPath:
8+
name: 'Bad{Path}'
9+
in: path
10+
schema: {}

0 commit comments

Comments
 (0)