Consider adapting industry-wide standards like OpenAPI for Path Templating Matching
Closed this issue · 2 comments
What is the issue with the URL Pattern Standard?
Users will transfer expectations they have built around one familiar product to another that appears similar.
src.: https://lawsofux.com/jakobs-law/
Path templating in urlpattern
works with /:path
instead as defined in OpenAPI standard with /path/{id}
(see https://swagger.io/specification/#paths-object )
Is there any possibility to adapt this?
I read https://github.com/whatwg/urlpattern/blob/main/explainer.md#references--acknowledgements, but after reading RFC 6570 1.4.
I can't come to the understanding that /:ident
should be preferred over /{ident}
. Especially if there is already an established specification used in the industry. Can you explain and give reasons, how you came to the conclusion in the readme?
The OpenAPI (Swagger) syntax is only one of several syntaxes already prevalent in the ecosystem. The syntax that was chosen was based on the popular path-to-regexp library, and is similar to, for example, the Ruby on Rails router syntax, among others. There are also concepts that are possible to express in the current syntax that I don't believe are expressible in the Swagger syntax, though I haven't dug in more detail.
The bottom line here, though, is that it's probably too late to make such a change in this case, as it would be backward incompatible and at least one engine (Chromium) has been shipping this syntax for some time.
That's unfortunate, and I would like to voice my criticism for that decision and going forward on it. :/ Because OpenAPI has/is a specification and is considered a standard spanning multiple ecosystems. A popular library in one ecosystem doesn't really define a standard outside their corresponding ecosystem (rails, express, etc.). Now another standard has been created, and we are again in the world of said XKCD comic strip. :(