-
Notifications
You must be signed in to change notification settings - Fork 487
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Rules around the URL casing #745
Comments
Your URLs consist of the hostname (lowercase, case insensitive), version (e.g. v1beta1, which is lowercase), resource name and optionally custom method. AIP-122 details resource names. Specifically:
AIP-136 details custom methods. Specifically:
Here's an excerpt from a Google API showing this in action: post: "/v3beta1/{parent=projects/*/locations/*/agents/*/sessions/*}/entityTypes" In this example above, And another example using a custom method: post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:matchIntent" Whether the path should be case sensitive, my guess is yes. |
That section of AIP-122 doesn't even make sense... RFC 1034 describes DNS, and section 3.5 covers the preferred syntax for host names (note: not arbitrary domain names) and was superseded by RFC 1123 anyway (to allow the first character of any label in an Internet host name to be an ASCII letter or digit). Note also that each DNS domain name is a sequence of labels, and "conform to RFC-1034" fails to convey intent that seems to be "be valid as a DNS label in an Internet host name conforming with the preferred syntax of RFC 1034 {as updated by,without the updates of} RFC 1123". That said, though, I can't imagine why API resource names should having anything to do with DNS domain name labels, and Unicode Standard Annex #31 (IDENTIFIER AND PATTERN SYNTAX) would seem much more applicable. |
How valuable would be to downcase everything and use either Or use I am getting lost reading the AIP, and I am craving for more rules that avoid bikeshedding |
@gibson042 Can you send a PR with what you think it ought to say? |
@lukesneeringer Yes, but I'd really like someone to explain the intent of the current text first. The Resource ID segments section seems clear, albeit with a surprising DNS RFC reference—IIUC, user-settable resource IDs should be matched by For reference, RFC 3986 defines URL path segments as consisting of any combination of unreserved (ASCII alphanumeric/dash/dot/underscore/tilde), pct-encoded, sub-delims (any of There's nothing wrong with "up to 63 ASCII characters with an initial letter, terminal alphanumeric, and inner alphanumerics and dashes, preferably all lowercase", it's just strange to couple it to DNS. Should I assume that we want to keep the general concept and drop the coupling, or should it go further and allow punctuation such as underscore (which is an ID_Continue character supported in Unicode identifiers)? |
Hey folk, hopefully, I didn't miss the docs, my apologies if I did.
I am trying to find a rule related to the URL casing, like, should my URLs be case insensitive, or not. and should I use dashes or underscore for separating words?
Would appreciate some alignment related to the topic.
Thanks in advanced,
The text was updated successfully, but these errors were encountered: