adds ABNF for path templating - #4244
Conversation
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Ralf Handl <ralf.handl@sap.com>
Co-authored-by: Ralf Handl <ralf.handl@sap.com>
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 |
Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
…m/baywet/OpenAPI-Specification into feat/url-template-anbf-to-3-2-dev
char0n
left a comment
There was a problem hiding this comment.
Thank you for your patience! Looks great!
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
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: