Skip to content

adds ABNF for path templating #4244

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

Merged
merged 13 commits into from
Dec 18, 2024
Merged
Prev Previous commit
Next Next commit
chore: moves RFC references outside of ABNF block for path templates
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Dec 17, 2024
commit e4caedca6906ee964690e8879a06eee7edc2fabc
4 changes: 2 additions & 2 deletions src/oas.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ The value for these path parameters MUST NOT contain any unescaped "generic synt
The path templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax

```abnf
; OpenAPI Path Templating ABNF syntax
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 }

; Characters definitions (from RFC 3986)
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
Expand All @@ -65,6 +63,8 @@ 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).

### Media Types

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