Skip to content

Commit 11835a5

Browse files
committed
Clarify URL chars and LRO guidance
1 parent c37fbfa commit 11835a5

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

azure/Guidelines.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,19 @@ Where:
7070

7171
:white_check_mark: **DO** return `414-URI Too Long` if a URL exceeds 2083 characters
7272

73-
:white_check_mark: **DO** treat URL path segments as case-sensitive. If the passed-in case doesn't match what the service expects, the request **MUST** fail with a `404-Not found` HTTP return code.
73+
:white_check_mark: **DO** treat service-defined URL path segments as case-sensitive. If the passed-in case doesn't match what the service expects, the request **MUST** fail with a `404-Not found` HTTP return code.
7474

75-
:ballot_box_with_check: **YOU SHOULD** keep URLs readable; if possible, avoid UUIDs & %-encoding (ex: Cádiz is %-encoded as C%C3%A1diz)
75+
Some customer-provided path segment values may be compared case-insensitivity if the abstraction they represent is normally compared with case-insensitivity. For example, a UUID path segment of 'c55f6b35-05f6-42da-8321-2af5099bd2a2' should be treated identical to 'C55F6B35-05F6-42DA-8321-2AF5099BD2A2'
7676

77-
:ballot_box_with_check: **YOU SHOULD** limit your URL's path characters to `0-9 A-Z a-z - . _ ~ :`
77+
:white_check_mark: **DO** ensure proper casing when returning a URL in an HTTP response header value or inside a JSON response body
7878

79-
:heavy_check_mark: **YOU MAY** use these other characters in the URL path but they will likely require %-encoding [[RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1)]: `/ ? # [ ] @ ! $ & ' ( ) * + , ; =`
79+
:ballot_box_with_check: **YOU SHOULD** restrict the characters in service-defined path segments to `0-9 A-Z a-z - . _ ~`, with `:` allowed only as described below to designate an action operation.
8080

81+
:ballot_box_with_check: **YOU SHOULD** restrict the characters allowed in path parameters to `0-9 A-Z a-z - . _ ~` (do not allow `:`).
8182

82-
Some customer-provided path segment values may be compared case-insensitivity if the abstraction they represent is normally compared with case-insensitivity. For example, a UUID path segment of 'c55f6b35-05f6-42da-8321-2af5099bd2a2' should be treated identical to 'C55F6B35-05F6-42DA-8321-2AF5099BD2A2'
83+
:ballot_box_with_check: **YOU SHOULD** keep URLs readable; if possible, avoid UUIDs & %-encoding (ex: Cádiz is %-encoded as C%C3%A1diz)
8384

84-
:white_check_mark: **DO** ensure proper casing when returning a URL in an HTTP response header value or inside a JSON response body
85+
:heavy_check_mark: **YOU MAY** use these other characters in the URL path but they will likely require %-encoding [[RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1)]: `/ ? # [ ] @ ! $ & ' ( ) * + , ; =`
8586

8687
#### Direct Endpoint URLs
8788

@@ -232,6 +233,8 @@ In addition to the above, a field may be "required" or "optional". A required fi
232233

233234
:white_check_mark: **DO** make fields simple and maintain a shallow hierarchy.
234235

236+
:white_check_mark: **DO** use camel case for all JSON field names.
237+
235238
:white_check_mark: **DO** treat JSON field names with case-sensitivity.
236239

237240
:white_check_mark: **DO** treat JSON field values with case-sensitivity. There may be some exceptions but avoid if at all possible.
@@ -737,7 +740,10 @@ The ability to retry failed requests for which a client never received a respons
737740

738741
### Long Running Operations & Jobs
739742

740-
The Microsoft REST API guidelines for Long Running Operations are an updated, clarified and simplified version of the Asynchronous Operations guidelines from the 2.1 version of the Azure API guidelines. Unfortunately, to generalize to the whole of Microsoft and not just Azure, the HEADER used in the operation was renamed from `Azure-AsyncOperation` to `Operation-Location`.
743+
Azure generally follows the [Microsoft REST API guidelines for Long running operations](https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#13-long-running-operations). Follow the Microsoft guidelines with the modifications / extensions given here when designing / implementing long running operations.
744+
745+
Previous Azure guidelines specified "Azure-AsyncOperation" as the name of the response header containing the operation URL,
746+
while the Microsoft guidelines use the name "Operation-Location".
741747

742748
:white_check_mark: **DO** support both `Azure-AsyncOperation` and `Operation-Location` HEADERS, even though they are redundant so that existing SDKs and clients will continue to operate.
743749

0 commit comments

Comments
 (0)