The runtime expression ABNF grammar defines:
name = *( char )
token = 1*tchar
The * (zero or more) quantifier on name means expressions like $request.query. and $request.path. with empty names are syntactically valid per the grammar.
The OpenAPI spec states that the Parameter Object's name field is REQUIRED:
REQUIRED. The name of the parameter. Parameter names are case-sensitive.
A required field with an empty string value is arguably not meaningful, though the spec doesn't explicitly say "non-empty".
For path parameters specifically, this is inconsistent with the path template grammar introduced in OpenAPI 3.2.0:
template-expression-param-name = 1*( %x00-7A / %x7C / %x7E-10FFFF )
The 1* quantifier requires at least one character for path parameter names. So {userId} is valid but {} is not. Yet the runtime expression $request.path. (empty name) is accepted by the grammar.
For query parameters, the situation is less clear — HTTP technically allows empty query parameter keys (?=value), though this is extremely uncommon.
For consistency with the path template grammar and the token = 1*tchar rule (which already requires at least one character for headers), consider changing:
to:
This would require at least one character for query and path parameter names, aligning the runtime expression grammar with the path template grammar.
The runtime expression ABNF grammar defines:
The
*(zero or more) quantifier onnamemeans expressions like$request.query.and$request.path.with empty names are syntactically valid per the grammar.The OpenAPI spec states that the Parameter Object's
namefield is REQUIRED:A required field with an empty string value is arguably not meaningful, though the spec doesn't explicitly say "non-empty".
For path parameters specifically, this is inconsistent with the path template grammar introduced in OpenAPI 3.2.0:
The
1*quantifier requires at least one character for path parameter names. So{userId}is valid but{}is not. Yet the runtime expression$request.path.(empty name) is accepted by the grammar.For query parameters, the situation is less clear — HTTP technically allows empty query parameter keys (
?=value), though this is extremely uncommon.For consistency with the path template grammar and the
token = 1*tcharrule (which already requires at least one character for headers), consider changing:to:
This would require at least one character for query and path parameter names, aligning the runtime expression grammar with the path template grammar.