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
@@ -26,27 +26,29 @@ The solution here is to add a 'sentinel' member named ```unknownFutureValue``` a
26
26
27
27
---
28
28
29
-
An enum member with the name of ```unknownFutureValue```**must** only be used as a sentinel value, an API producer **must** not include a member named ```unknownFutureValue``` in an enum for any other purpose.
29
+
-An enum member with the name of ```unknownFutureValue```**must** only be used as a sentinel value, an API producer **must** not include a member named ```unknownFutureValue``` in an enum for any other purpose.
30
30
31
-
The value (i.e. position) of the ```unknownFutureValue``` sentinel member can only be changed when a new major version of Graph (e.g. 2.0) is released.
31
+
- Changing the value (i.e. position) of the ```unknownFutureValue``` sentinel member is considered a breaking change, and must follow the [deprecation](../deprecation.md) process.
32
32
33
-
Enum Types can have multiple members with the same numeric value to allow for aliasing enum members, ```unknownFutureValue```**must** not be aliased to any other enum member.
33
+
-Enum Types can have multiple members with the same numeric value to allow for aliasing enum members, ```unknownFutureValue```**must** not be aliased to any other enum member.
34
34
35
-
There is no ability for a client to indicate that it can handle a subset of unknown enum members, instead that can only specify either that they can not handle any unknown enum members, or they can handle any unknown enum members.
35
+
-There is no ability for a client to indicate that it can handle a subset of unknown enum members, instead that can only specify either that they can not handle any unknown enum members, or they can handle any unknown enum members.
36
36
37
-
The ```Prefer: include-unknown-enum-members``` header applies to all included enums in the request/response, there is no way for an API consumer to apply the behavior to only a subset of enum types.
37
+
-The ```Prefer: include-unknown-enum-members``` header applies to all included enums in the request/response, there is no way for an API consumer to apply the behavior to only a subset of enum types.
38
38
39
-
New values **must** not be inserted into the enum before ```unknownFutureValue```, implementers are recommended to make the numeric value of ```unknownFutureValue``` one greater than the last known enum member to ensure there are no gaps into which a new member could be inadvertently added. The exception to this is the case of flagged enums in which case the value of ```unknownFutureValue``` should be be next power of 2 value.
39
+
-New values **must** not be inserted into the enum before ```unknownFutureValue```, implementers are recommended to make the numeric value of ```unknownFutureValue``` one greater than the last known enum member to ensure there are no gaps into which a new member could be inadvertently added. The exception to this is the case of flagged enums in which case the value of ```unknownFutureValue``` should be be next power of 2 value.
40
40
41
-
For flagged enums care should be exercised to ensure that ```unknownFutureValue``` is not included in any enum members that represent a combination of other enum members.
41
+
-For flagged enums care should be exercised to ensure that ```unknownFutureValue``` is not included in any enum members that represent a combination of other enum members.
42
42
43
-
If an API consumer specifies ```unknownFutureValue``` for the value of a property in a ```POST```/```PUT``` request or as parameter of an action or function the API producer must reject the request with a ```400 Bad Request```HTTP status.
43
+
-If the value of a property containing a flag enum contains multiple unknown values they should all be replaced with a single ```unknownFutureValue``` value (i.e. there should not have multiple ```unknownFutureValue```values returned).
44
44
45
-
If an API consumer specifies ```unknownFutureValue``` for the value of a property in a ```PATCH``` request the API producer must treat the property as if it were absent (i.e. the existing value should not be changed). For the case where the API producer treats ```PATCH``` as an upsert the call **must** be rejected with a ```400 Bad Request``` HTTP status.
45
+
-If an API consumer specifies ```unknownFutureValue``` for the value of a property in a ```POST```/```PUT``` request or as parameter of an action or function the API producer must reject the request with a ```400 Bad Request``` HTTP status.
46
46
47
-
If an API consumer specifies an enum member greater than ```unknownFutureValue```in any request without specifying the ```Prefer: include-unknown-enum-members```header the API producer must reject the request with a ```400 Bad Request``` HTTP status.
47
+
-If an API consumer specifies ```unknownFutureValue```for the value of a property in a ```PATCH```request the API producer must treat the property as if it were absent (i.e. the existing value should not be changed). For the case where the API producer treats ```PATCH``` as an upsert the call **must** be rejected with a ```400 Bad Request``` HTTP status.
48
48
49
-
For details of how the ```unknownFutureValue``` value is handled as part of a ```$filter``` clause please consult the following examples.
49
+
- If an API consumer specifies an enum member greater than ```unknownFutureValue``` in any request without specifying the ```Prefer: include-unknown-enum-members``` header the API producer must reject the request with a ```400 Bad Request``` HTTP status.
50
+
51
+
- For details of how the ```unknownFutureValue``` value is handled as part of a ```$filter``` clause please consult the following examples:
50
52
51
53
### CSDL
52
54
@@ -74,7 +76,7 @@ For details of how the ```unknownFutureValue``` value is handled as part of a ``
74
76
|```enumProperty gt newValue```|```400 Bad Request```| Return entities where enumProperty has a value greater than ```newValue```|
75
77
|```enumProperty lt newValue```|```400 Bad Request```| Return entities where enumProperty has a value less than ```newValue```|
76
78
77
-
If an evolvable enum is included in an ```$orderby``` clause the actual numeric value of the member should be used to order the collection, after sorting the member should then be replaced with ```unknownFutureValue``` when the ```Prefer: include-unknown-enum-members``` header is absent.
79
+
-If an evolvable enum is included in an ```$orderby``` clause the actual numeric value of the member should be used to order the collection, after sorting the member should then be replaced with ```unknownFutureValue``` when the ```Prefer: include-unknown-enum-members``` header is absent.
In this case the value of the ```applicableArchitectures``` property includes ```quantum``` however since the client did not request the ```include-unknown-enum-members``` header the value was replaced with ```unknownFutureValue```
385
+
386
+
### Flag Enum Include opt-in Header
387
+
388
+
```http
389
+
GET https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps?$select=displayName,applicableArchitectures
390
+
391
+
Prefer: include-unknown-enum-members
392
+
```
393
+
394
+
```json
395
+
Preference-Applied: include-unknown-enum-members
396
+
397
+
{
398
+
"value": [
399
+
{
400
+
"id": "0",
401
+
"displayName": "OneNote",
402
+
"applicableArchitectures" : "neutral"
403
+
},
404
+
{
405
+
"id": "1",
406
+
"displayName": "Minecraft",
407
+
"applicableArchitectures": "x86,x64,arm,quantum"
408
+
}
409
+
{
410
+
"id": "2",
411
+
"displayName": "Edge",
412
+
"applicableArchitectures": "x64,arm,quantum"
413
+
}
414
+
]
415
+
}
416
+
```
417
+
418
+
### Flag Enum Default Filter Behavior
419
+
420
+
```http
421
+
GET https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps?$select=displayName,applicableArchitectures&$filter=applicableArchitectures has unknownFutureValue
### Flag Enum Include opt-in Header Filter Behavior
442
+
443
+
```http
444
+
GET https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps?$select=displayName,applicableArchitectures&$filter=applicableArchitectures has unknownFutureValue
0 commit comments