-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
adds ABNF for path templating #4244
Conversation
Signed-off-by: Vincent Biret <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits
Co-authored-by: Ralf Handl <[email protected]>
Co-authored-by: Ralf Handl <[email protected]>
We primarily define thing in terms of JSON, and (as mentioned in one of the new appendixes), JSON strings are only broadly interoperable in UTF-8, per the JSON RFC. It might be worth mentioning that here, but I think it's reasonable for us to write the spec based on what is interoperable in JSON. |
Here is the latest version of ABNF I've come up in https://github.com/swaggerexpert/openapi-path-templating/blob/next/src/path-templating.bnf ; OpenAPI Path Templating ABNF syntax
; Aligned with RFC 3986 (https://datatracker.ietf.org/doc/html/rfc3986#section-3.3)
path-template = slash [ path-template-nz ]
path-template-nz = path-segment *( slash path-segment )
slash = "/"
path-segment = 1*( path-literal / template-expression )
path-literal = 1*pchar
template-expression = "{" template-expression-param-name "}"
template-expression-param-name = 1*pchar
; Characters definitions (from RFC 3986)
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
DIGIT = %x30-39 ; 0-9
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" This grammar is now as closely aligned with https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 as it can be. |
Just a small note related to licensing. I do support this effort fully, but seeing this PR, I got a bit worried how this ABNF grammar is being copied here from I've created the original ABNF grammar in https://github.com/swaggerexpert/openapi-path-templating and is licensed under
The NOTICE file is part of https://github.com/swaggerexpert/openapi-path-templating repo and npm package distribution. Can we as part of this repo (https://github.com/OAI/OpenAPI-Specification) create a NOTICE file (standard practice with Apache-2.0 licensing) and mention the attribution of |
@char0n thanks for the suggestions here! |
Co-authored-by: Vladimír Gorej <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
Co-authored-by: Vladimír Gorej <[email protected]>
Signed-off-by: Vincent Biret <[email protected]>
…m/baywet/OpenAPI-Specification into feat/url-template-anbf-to-3-2-dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience! Looks great!
Signed-off-by: Vincent Biret <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
partial #3256
This pull request adds an ABNF for path templating.
It only partially addresses the issue, my goal is to submit additional pull requests for: