Skip to content

Commit 9f092bd

Browse files
author
Dan Kershaw [MSFT]
committed
Addressed a couple of comments
1 parent f5f9684 commit 9f092bd

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

graph/GuidelinesGraph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ If possible, APIs SHOULD use resource-based designs with standard HTTP methods r
257257
| Microsoft Graph rules for modeling behavior |
258258
|------------------------------------------------------------------|
259259
| :heavy_check_mark: **MUST** use POST to create new entities in insertable entity sets or collections.<BR>This approach requires the server to produce a system generated key. |
260-
| :heavy_check_mark: **MAY** use PATCH to create new entities in insertable entity sets or collections.<BR>This [Upsert](./patterns/upsert.md) approach requires the caller to provide a key. |
260+
| :ballot_box_with_check: **SHOULD** additionally use PATCH to create new entities in insertable entity sets or collections.<BR>This [Upsert](./patterns/upsert.md) approach requires the caller to provide a key. |
261261
| :heavy_check_mark: **MUST** use PATCH to edit updatable resources. |
262262
| :heavy_check_mark: **MUST** use DELETE to delete deletable resources. |
263263
| :heavy_check_mark: **MUST** use GET for listing and reading resources. |
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Default properties and $select
2+
3+
Microsoft Graph API Design Pattern
4+
5+
*Provide a short description of the pattern.*
6+
7+
8+
## Problem
9+
10+
*Describe the business context relevant for the pattern.*
11+
12+
*Provide a short description of the problem.*
13+
14+
## Solution
15+
16+
*Describe how to implement the solution to solve the problem.*
17+
18+
*Describe related patterns.*
19+
20+
## When to use this pattern
21+
22+
*Describe when and why the solution is applicable and when it might not be.*
23+
24+
## Issues and considerations
25+
26+
*Describe tradeoffs of the solution.*
27+
28+
## Example
29+
30+
*Provide a short example from real life.*

graph/patterns/upsert.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,37 @@ Preference-Applied: idempotent; return=representation
154154

155155
Notice how this operation is idempotent in nature, rather than returning a 409 conflict error.
156156

157+
### Updating a record
158+
159+
Update "Group157" group with a new description.
160+
161+
```http
162+
PATCH /groups(uniqueName='Group157')
163+
Prefer: idempotent; return=representation
164+
```
165+
166+
```json
167+
{
168+
"description": "Some of my favorite people in the world."
169+
}
170+
```
171+
172+
Response:
173+
174+
```http
175+
200 ok
176+
Preference-Applied: idempotent; return=representation
177+
```
178+
179+
```json
180+
{
181+
"id": "1a89ade6-9f59-4fea-a139-23f84e3aef66",
182+
"displayName": "My favorite group",
183+
"description": "Some of my favorite people in the world.",
184+
"uniqueName": "Group157"
185+
}
186+
```
187+
157188
### Upsert not supported
158189

159190
Create a new group, with a `uniqueName` of "Group157". In this case, this group does not exist and additionally

0 commit comments

Comments
 (0)