Skip to content

Commit 96633b1

Browse files
committed
formatting
1 parent d02a97c commit 96633b1

File tree

2 files changed

+20
-28
lines changed

2 files changed

+20
-28
lines changed

graph/GuidelinesGraph.docx

-55.5 KB
Binary file not shown.

graph/GuidelinesGraph.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ Table of Contents
1515
- [Query Support](#query-support)
1616
- [Recommended Modeling Patterns](#recommended-modeling-patterns)
1717
- [Behavior Modeling](#behavior-modeling)
18-
- [HTTP Operations](#http-operations)
1918
- [Microsoft Graph rules for modeling behavior](#microsoft-graph-rules-for-modeling-behavior)
2019
- [Error Handling](#error-handling)
2120
- [API contract and non-backward compatible changes](#api-contract-and-non-backward-compatible-changes)
2221
- [Versioning and Deprecation](#versioning-and-deprecation)
2322
- [Deprecation Process](#deprecation-process)
24-
- [Common API Patterns](#common-api-patterns)
23+
- [Recommended API Patterns](#recommended-api-patterns)
2524
- [References](#references)
2625

2726
##
@@ -55,6 +54,9 @@ guidelines. Readers are assumed also be reading the Microsoft REST API
5554
guidelines and be familiar with them. Graph guidance is a superset of the
5655
Microsoft API guidelines and services should follow them except where this
5756
document outlines specific differences or exceptions to those guidelines.
57+
Together these guidelines and a library of API patterns serve as the means by which API teams discuss and come
58+
to consensus on API review recommendations.
59+
5860

5961
This document borrows heavily from multiple public sources such as:
6062

@@ -70,6 +72,7 @@ issue](https://github.com/microsoft/api-guidelines/issues/new/choose) to suggest
7072
a change or propose a new idea.
7173

7274
### Legend
75+
7376
This document offers prescriptive guidance labeled as follows:
7477

7578
:heavy_check_mark: **DO** satisfy this specification. If not following this advice, you MUST disclose your reason during the Graph API review.
@@ -130,7 +133,7 @@ identify potential error scenarios with secure and descriptive messaging.
130133
Consistent naming is foundational for API usability. API resources are typically
131134
described by nouns. You need to consider that resources and property names
132135
appear in API URLs and payloads and should be descriptive and easy to
133-
understand. Therefore you should follow the rules in the table below:
136+
understand. Therefore you should satisfy the following requirements summarized in the table below:
134137
|Requirements|Example|
135138
|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
136139
| :no_entry: **DO NOT** use redundant words in names. |- **Right:** /places/{id}/**type** and /phones/{id}/**number** <BR> - **Wrong** /places/{id}/*placeType* and /phones/{id}/**phoneNumber** |
@@ -165,7 +168,7 @@ understand. Therefore you should follow the rules in the table below:
165168
A Uniform Resource Locator (URL) is how developers access the resources of your
166169
API.
167170

168-
Navigation path to Graph resources generally broken into multiple segments:
171+
Navigation path to the Microsoft Graph resources generally broken into multiple segments:
169172

170173
**{scheme}://{host}/{version}/{category}/{resourcePath}[?{query}]** where
171174

@@ -177,7 +180,7 @@ Navigation path to Graph resources generally broken into multiple segments:
177180
- **category** segment is modeled as an entity set or a singleton representing
178181
logical top-level API category;
179182

180-
- **resourcePath segment** can address an entity, collection of entities,
183+
- **resourcePath** segment can address an entity, collection of entities,
181184
property or operation available for an entity. Structure of the resource
182185
path is covered in detail in the [OData Version 4.01. Part 2: URL
183186
Conventions](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html);
@@ -186,9 +189,8 @@ Navigation path to Graph resources generally broken into multiple segments:
186189
and is covered in [Query](#query) section.
187190

188191
While HTTP defines no constraints on how different resources are related
189-
together, it does encourage the use of URL path segment hierarchies to convey a
190-
relationship. In Microsoft Graph lifetime relationships between resources
191-
supported by the notions of singletons, entitySets, entities, complex types and
192+
together, it does encourage the use of URL path segment hierarchies to convey relationships. In Microsoft Graph lifetime relationships between resources are
193+
supported by the OData concepts of singletons, entitySets, entities, complex types and
192194
navigation properties.
193195

194196
#### Category
@@ -212,8 +214,7 @@ enterprise perspectives and represents one of the following:
212214
- For example: /loadTestEntities
213215
>>
214216
Top-level API categories are aligned with documentation, developer tools, and in
215-
general are relatively stable. If a new category needs to be created, it requires an API REview and an API Council approval.
216-
217+
general are relatively stable. If a new category needs to be created, it requires an API Review and an API Council approval.
217218
### Query Support
218219

219220
Microsoft Graph APIs should support basic query options in conformance with
@@ -238,10 +239,7 @@ Limitations of \$query requests made to Microsoft Graph:
238239

239240
The query options part of an OData URL can be quite long, potentially exceeding
240241
the maximum length of URLs supported by components involved in transmitting or
241-
processing the request. One way to avoid this is wrapping the request in a batch
242-
request, which has the penalty of needing to construct a well-formed batch
243-
request body. An easier alternative for GET requests is to append /\$query to
244-
the resource path of the URL, use the POST verb instead of GET, and pass the
242+
processing the request. One way to avoid this is to use the POST verb instead of GET, and pass the
245243
query options part of the URL in the request body as described in the chapter
246244
[OData Query
247245
Options](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_PassingQueryOptionsintheRequestBody).
@@ -277,7 +275,7 @@ of properties are three most often used patterns in Microsoft Graph today:
277275
also defines properties that are required/meaningful for the variant given
278276
by the type property. [Modelling with Flat Bag Pattern](./Modelling%20with%20Flat%20Bag%20Pattern.md)
279277

280-
The following table describes shows summary of main qualities for each pattern
278+
The following table shows summary of main qualities for each pattern
281279
and will help to select a pattern preferred for your use case.
282280

283281
| API qualities Patterns | Properties and behavior described in metadata | Suited for strongly typed languages | Simple query construction | Syntactical backward compatible |
@@ -288,8 +286,6 @@ and will help to select a pattern preferred for your use case.
288286

289287
## Behavior Modeling
290288

291-
#### HTTP Operations
292-
293289
The HTTP operations dictate how your API behaves. The URL of an API, along with
294290
its request/response bodies, establishes the overall contract that developers
295291
have with your service. As an API provider, how you manage the overall request /
@@ -395,14 +391,14 @@ In general, making changes to the API contract for existing elements is
395391
considered breaking. Adding new elements is allowed and not considered a
396392
breaking change.
397393

398-
:heavy_check_mark: **DO use not-breaking changes:**
394+
** Non-breaking changes:**
399395
* Addition of an annotation OpenType="true" Addition of properties that are nullable or have a default value
400396
* Addition of a member to an evolvable enumeration 1. Removal, rename, or change to the type of an open extension
401397
* Removal, rename, or change to the type of an annotation *Introduction of paging to existing collections
402398
* Changes to error codes Changes to the order of properties
403399
* Changes to the length or format of opaque strings, such as resource IDs
404400

405-
:no_entry: **DO NOT use breaking changes:**
401+
** Breaking changes:**
406402
* Changes to the URL or fundamental request/response associated with a resource
407403
* Changing semantics of resource representation
408404
* Removal, rename, or change to the type of a declared property
@@ -521,19 +517,15 @@ Link: https://docs.microsoft.com/en-us/graph/changelog#2022-03-30_name ; rel="de
521517
bound by the quarterly cadence or minimal support period before removal of
522518
deprecated elements.
523519

524-
## Common API Patterns
520+
## Recommended API Patterns
525521

526522
The guidelines in previous sections are intentionally brief and provide a
527-
jump start for a Graph API developer. More detailed design guidance on REST APIs is
523+
jump start for Graph API developers. More detailed design guidance on REST APIs is
528524
published at the [Microsoft REST API
529-
Guidelines](https://github.com/microsoft/api-guidelines/) and Graph specific are
525+
Guidelines](https://github.com/microsoft/api-guidelines/) and Graph specific patterns are
530526
outlined in the table below.
531527

532-
**API Patterns** are design documents providing best practices for MS Graph API
533-
development. They are to serve as the means by which API teams discuss and come
534-
to consensus on API guidance and review API designs.
535-
536-
You can find references in the most common patterns in the table below:
528+
Recommended API Design patterns:
537529

538530
| Pattern | Description | Reference |
539531
|-------------------------|-------------|----------------------------------------------------------------------------------------------------------|
@@ -546,7 +538,7 @@ You can find references in the most common patterns in the table below:
546538
| Evolvable Enums | The ability to enable non-breaking changes for Enum type. | |
547539
| Type Namespace | The ability to reduce the need to prefix types with a qualifier to ensure uniqueness. |
548540
| Change Tracking | The ability to get notified (push) when a change occurs in the data exposed by Microsoft Graph |
549-
| Long Running Operations |The ability to model asynch operations. | |
541+
| Long Running Operations |The ability to model asynchronous operations. | |
550542
| Delta Queries | The ability to query changes in the data exposed by Microsoft Graph | |
551543
|Navigation Properties | |
552544
|Viewpoint | |

0 commit comments

Comments
 (0)