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: graph/patterns/dictionary.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ The API design requires a resource to include an unknown quantity of data elemen
10
10
11
11
## Solution
12
12
13
-
API designers use a JSON object to represent a dictionary in an `application/json` response payload. When describing the model in CSDL, a new complex type can be created that derives from `Org.OData.Core.V1.Dictionary` and then uses the `Org.OData.Validation.V1.OpenPropertyTypeConstraint` to constrain the type that can be used for the values in the dictionary.
13
+
API designers use a JSON object to represent a dictionary in an `application/json` response payload. When describing the model in CSDL, a new complex type can be created that derives from `Org.OData.Core.V1.Dictionary` and then uses the `Org.OData.Validation.V1.OpenPropertyTypeConstraint` to constrain the type that can be used for the values in the dictionary as appropriate.
14
14
15
-
Dictionary entries can be added via `POST`, updated via `PATCH`, and removed by setting the entry value to `null`. Multiple entries can be updated at the same time by using `PATCH` on the dictionary property.
15
+
Dictionary values can be added, removed, or modified via `PATCH` to the dictionary property. Values are removed by setting the property to `null`.
16
16
17
17
## When to use this pattern
18
18
@@ -36,8 +36,9 @@ Because dictionary entries are removed by setting the value to `null`, dictionar
36
36
Open questions:
37
37
38
38
- Can/should PUT be supported on the dictionary property and/or the entry value?
39
-
- What does OData say about being able to POST to a structured property? Will OData Web API allow that?
40
39
- Must an implementer support PATCH at both the dictionary level and the entry level?
40
+
- Should we also allow DELETE to a property to be equivalent to setting to null?
41
+
- Why do we not allow mixed primitives or mixed primitive/complex typed values? what about collections?
41
42
42
43
For more information, see the [OData reference](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#dictionary).
43
44
@@ -130,7 +131,7 @@ Response:
130
131
#### Create an entry in the dictionary
131
132
132
133
```HTTP
133
-
POST https://graph.microsoft.com/v1.0/users/10/roles/author
0 commit comments