You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Guidelines.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -380,7 +380,7 @@ Because PUT is defined as a complete replacement of the content, it is dangerous
380
380
Clients that do not understand (and hence ignore) properties on a resource are not likely to provide them on a PUT when trying to update a resource, hence such properties could be inadvertently removed.
381
381
Services MAY optionally support PUT to update existing resources, but if they do they MUST use replacement semantics (that is, after the PUT, the resource's properties MUST match what was provided in the request, including deleting any server properties that were not provided).
382
382
383
-
Under UPSERT semantics, a PATCH call to a nonexistent resource is handled by the server as a "create," and a PATCH call to an existing resource is handled as an "update." To ensure that an update request is not treated as a create or vice versa, the client MAY specify precondition HTTP headers in the request.
383
+
Under UPSERT semantics, a PATCH call to a nonexistent resource is handled by the server as a "create", and a PATCH call to an existing resource is handled as an "update". To ensure that an update request is not treated as a create or vice versa, the client MAY specify precondition HTTP headers in the request.
384
384
The service MUST NOT treat a PATCH request as an insert if it contains an If-Match header and MUST NOT treat a PATCH request as an update if it contains an If-None-Match header with a value of "*".
385
385
386
386
If a service does not support UPSERT, then a PATCH call against a resource that does not exist MUST result in an HTTP "409 Conflict" error.
@@ -501,14 +501,14 @@ However, it is very generic and does not require specific OData constructs.
501
501
APIs SHOULD use this format even if they are not using other OData constructs.
502
502
503
503
The error response MUST be a single JSON object.
504
-
This object MUST have a name/value pair named "error." The value MUST be a JSON object.
504
+
This object MUST have a name/value pair named "error". The value MUST be a JSON object.
505
505
506
-
This object MUST contain name/value pairs with the names "code" and "message," and it MAY contain name/value pairs with the names "target," "details" and "innererror."
506
+
This object MUST contain name/value pairs with the names "code" and "message", and it MAY contain name/value pairs with the names "target", "details" and "innererror."
507
507
508
508
The value for the "code" name/value pair is a language-independent string.
509
509
Its value is a service-defined error code that SHOULD be human-readable.
510
510
This code serves as a more specific indicator of the error than the HTTP error code specified in the response.
511
-
Services SHOULD have a relatively small number (about 20) of possible values for "code," and all clients MUST be capable of handling all of them.
511
+
Services SHOULD have a relatively small number (about 20) of possible values for "code", and all clients MUST be capable of handling all of them.
512
512
Most services will require a much larger number of more specific error codes, which are not interesting to all clients.
513
513
These error codes SHOULD be exposed in the "innererror" name/value pair as described below.
514
514
Introducing a new value for "code" that is visible to existing clients is a breaking change and requires a version increase.
@@ -521,13 +521,13 @@ Services SHOULD NOT localize "message" for the end user, because doing so might
521
521
522
522
The value for the "target" name/value pair is the target of the particular error (e.g., the name of the property in error).
523
523
524
-
The value for the "details" name/value pair MUST be an array of JSON objects that MUST contain name/value pairs for "code" and "message," and MAY contain a name/value pair for "target," as described above.
524
+
The value for the "details" name/value pair MUST be an array of JSON objects that MUST contain name/value pairs for "code" and "message", and MAY contain a name/value pair for "target", as described above.
525
525
The objects in the "details" array usually represent distinct, related errors that occurred during the request.
526
526
See example below.
527
527
528
528
The value for the "innererror" name/value pair MUST be an object.
529
529
The contents of this object are service-defined.
530
-
Services wanting to return more specific errors than the root-level code MUST do so by including a name/value pair for "code" and a nested "innererror." Each nested "innererror" object represents a higher level of detail than its parent.
530
+
Services wanting to return more specific errors than the root-level code MUST do so by including a name/value pair for "code" and a nested "innererror". Each nested "innererror" object represents a higher level of detail than its parent.
531
531
When evaluating errors, clients MUST traverse through all of the nested "innererrors" and choose the deepest one that they understand.
532
532
This scheme allows services to introduce new error codes anywhere in the hierarchy without breaking backwards compatibility, so long as old error codes still appear.
533
533
The service MAY return different levels of depth and detail to different callers.
@@ -591,7 +591,7 @@ Example of "innererror":
591
591
}
592
592
```
593
593
594
-
In this example, the most basic error code is "BadArgument," but for clients that are interested, there are more specific error codes in "innererror."
594
+
In this example, the most basic error code is "BadArgument", but for clients that are interested, there are more specific error codes in "innererror."
595
595
The "PasswordReuseNotAllowed" code may have been added by the service at a later date, having previously only returned "PasswordDoesNotMeetPolicy."
596
596
Existing clients do not break when the new error code is added, but new clients MAY take advantage of it.
597
597
The "PasswordDoesNotMeetPolicy" error also includes additional name/value pairs that allow the client to determine the server's configuration, validate the user's input programmatically, or present the server's constraints to the user within the client's own localized messaging.
@@ -655,7 +655,7 @@ The spirit behind CORS is to avoid preflight for any simple cross-domain request
655
655
All other requests require preflight.
656
656
657
657
A request is "simple" and avoids preflight if its method is GET, HEAD or POST, and if it doesn't contain any request headers besides Accept, Accept-Language and Content-Language.
658
-
For POST requests, the Content-Type header is also allowed, but only if its value is "application/x-www-form-urlencoded," "multipart/form-data" or "text/plain."
658
+
For POST requests, the Content-Type header is also allowed, but only if its value is "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain."
659
659
For any other headers or values, a preflight request will happen.
660
660
661
661
### 8.2. Service guidance
@@ -680,7 +680,7 @@ Services used by interactive Web clients where performance is critical SHOULD av
680
680
- Avoid requiring cookies. XmlHttpRequest will only send cookies on cross-domain requests if the "withCredentials" attribute is set; this also causes a preflight request.
681
681
- Services that require cookie-based authentication MUST use a "dynamic canary" to secure all APIs that accept cookies.
682
682
683
-
- For POST calls, prefer simple Content-Types in the set of ("application/x-www-form-urlencoded," "multipart/form-data," "text/plain") where applicable. Any other Content-Type will induce a preflight request.
683
+
- For POST calls, prefer simple Content-Types in the set of ("application/x-www-form-urlencoded", "multipart/form-data", "text/plain") where applicable. Any other Content-Type will induce a preflight request.
684
684
- Services MUST NOT contravene other API recommendations in the name of avoiding CORS preflight requests. In particular, in accordance with recommendations, most POST requests will actually require a preflight request due to the Content-Type.
685
685
- If eliminating preflight is critical, then a service MAY support alternative mechanisms for data transfer, but the RECOMMENDED approach MUST also be supported.
686
686
@@ -1205,7 +1205,7 @@ O | RealNumber | "OLE Date"; integral part is the number of days sin
1205
1205
T | SignedInteger | "Ticks"; number of ticks (100-nanosecond intervals) since midnight January 1, 1601. *See note below.* | [MSDN][ticks-time]
1206
1206
U | SignedInteger | "UNIX"; number of seconds since midnight, January 1, 1970. | [MSDN][unix-time]
1207
1207
W | SignedInteger | "Windows"; number of milliseconds since midnight January 1, 1601. *See note below.* | [MSDN][windows-time]
1208
-
X | RealNumber | "Excel"; as for `O` but the year 1900 is incorrectly treated as a leap year, and day 0 is "January 0 (zero)." | [Microsoft Support][excel-time]
1208
+
X | RealNumber | "Excel"; as for `O` but the year 1900 is incorrectly treated as a leap year, and day 0 is "January 0 (zero)". | [Microsoft Support][excel-time]
1209
1209
1210
1210
**Important note for `C` and `W` kinds:** The native CLR and Windows times are represented by 100-nanosecond "tick" values.
1211
1211
To interoperate with ECMAScript clients that have limited precision, _these values MUST be converted to and from milliseconds_ when (de)serialized as a `DateLiteral`.
@@ -1252,15 +1252,15 @@ For example, "P3Y6M4DT12H30M5S" represents a duration of "three years, six month
1252
1252
- Start and end, such as "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z"
1253
1253
- Start and duration, such as "2007-03-01T13:00:00Z/P1Y2M10DT2H30M"
1254
1254
- Duration and end, such as "P1Y2M10DT2H30M/2008-05-11T15:30:00Z"
1255
-
- Duration only, such as "P1Y2M10DT2H30M," with additional context information
1255
+
- Duration only, such as "P1Y2M10DT2H30M", with additional context information
1256
1256
1257
1257
### 11.6. Repeating intervals
1258
1258
[Repeating Intervals][wikipedia-iso8601-repeatingintervals], as per [ISO 8601][wikipedia-iso8601-repeatingintervals], are:
1259
1259
1260
1260
> Formed by adding "R[n]/" to the beginning of an interval expression, where R is used as the letter itself and [n] is replaced by the number of repetitions.
1261
1261
Leaving out the value for [n] means an unbounded number of repetitions.
1262
1262
1263
-
For example, to repeat the interval of "P1Y2M10DT2H30M" five times starting at "2008-03-01T13:00:00Z," use "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M."
1263
+
For example, to repeat the interval of "P1Y2M10DT2H30M" five times starting at "2008-03-01T13:00:00Z", use "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M."
1264
1264
1265
1265
## 12. Versioning
1266
1266
**All APIs compliant with the Microsoft REST API Guidelines MUST support explicit versioning.** It's critical that clients can count on services to be stable over time, and it's critical that services can add features and make changes.
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@ We further hope that these guidelines may encourage other organizations to creat
9
9
### Additional guidance for Azure service teams
10
10
Azure service teams should reference the companion documents, [Azure REST API Guidelines](./azure/Guidelines.md) and [Considerations for Service Design](./azure/ConsiderationsForServiceDesign.md), when building or modifying their services. These documents provide a refined set of guidance targeted specifically for Azure services. For more information please refer to the [README](./azure/README.md) in the Azure folder.
11
11
12
+
### Additional guidance for Microsoft Graph service teams
13
+
Graph service teams should reference the companion document, [Graph REST API Guidelines](./graph/GuidelinesGraph.md) when building or modifying their services. This document and the associated pattern catalog provides a refined set of guidance targeted specifically for Microsoft Graph services.
14
+
12
15
[](https://creativecommons.org/licenses/by/4.0/)
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
+
7
+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8
+
9
+
## Reporting Security Issues
10
+
11
+
**Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14
+
15
+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16
+
17
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18
+
19
+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+
* Full paths of source file(s) related to the manifestation of the issue
23
+
* The location of the affected source code (tag/branch/commit or direct URL)
24
+
* Any special configuration required to reproduce the issue
25
+
* Step-by-step instructions to reproduce the issue
26
+
* Proof-of-concept or exploit code (if possible)
27
+
* Impact of the issue, including how an attacker might exploit the issue
28
+
29
+
This information will help us triage your report more quickly.
30
+
31
+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32
+
33
+
## Preferred Languages
34
+
35
+
We prefer all communications to be in English.
36
+
37
+
## Policy
38
+
39
+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
0 commit comments