Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds ABNF for path templating #4244

Merged
merged 13 commits into from
Dec 18, 2024
21 changes: 21 additions & 0 deletions src/oas.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ Each template expression in the path MUST correspond to a path parameter that is

The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3): forward slashes (`/`), question marks (`?`), or hashes (`#`).

The path templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax

```abnf
path-template = "/" *( path-segment "/" ) [ path-segment ]
path-segment = 1*( path-literal / template-expression )
path-literal = 1*pchar
template-expression = "{" template-expression-param-name "}"
template-expression-param-name = 1*( %x00-79 / %x7C / %x7E-10FFFF ) ; every UTF8 character except { and }

pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
baywet marked this conversation as resolved.
Show resolved Hide resolved
DIGIT = %x30-39 ; 0-9
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
```

Here, all characters definitions are taken from [RFC 3986](https://tools.ietf.org/html/rfc3986). The path-template is directly derived from [RFC 3986, section 3.3](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3).
baywet marked this conversation as resolved.
Show resolved Hide resolved

### Media Types

Media type definitions are spread across several resources.
Expand Down
Loading