Skip to content

Commit 9c109ed

Browse files
Apply suggestions from code review
Co-authored-by: Dan Kershaw [MSFT] <[email protected]>
1 parent dcba8e2 commit 9c109ed

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

graph/patterns/evolvable-enums.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Frequently API producers want to add new members to an enum type after it is ini
1212
## Solution
1313

1414
---
15-
The solution here is to add a 'sentinel' member named ```unknownFutureValue``` at the end of the currently known enum members. The API producer will then replace any member that is numerically after ```unknownFutureValue``` with ```unknownFutureValue```. If an API consumer can handle unknown enum values the consumer can opt into receiving the unknown enum members by specifying the ```Preference: include-unknown-enum-members``` HTTP Header in their request(s), the API producer will then indicate that this preference has been applied by returning the ```Preference-Applied: include-unknown-enum-member``` HTTP header in the response.
15+
The solution here is to add a 'sentinel' member named ```unknownFutureValue``` at the end of the currently known enum members. The API producer will then replace any member that is numerically after ```unknownFutureValue``` with ```unknownFutureValue```. If an API consumer can handle unknown enum values the consumer can opt into receiving the unknown enum members by specifying the ```Preference: include-unknown-enum-members``` HTTP Header in their request(s), the API producer will then indicate that this preference has been applied by returning the ```Preference-Applied: include-unknown-enum-members``` HTTP header in the response.
1616

1717
## When to Use this Pattern
1818

@@ -155,6 +155,8 @@ Preference: include-unknown-enum-members
155155
```
156156

157157
```json
158+
Preference-Applied: include-unknown-enum-members
159+
158160
{
159161
"value": [
160162
{
@@ -207,6 +209,8 @@ Preference: include-unknown-enum-members
207209
```
208210

209211
```json
212+
Preference-Applied: include-unknown-enum-members
213+
210214
{
211215
"value": [
212216
{
@@ -255,6 +259,8 @@ Preference: include-unknown-enum-members
255259
```
256260

257261
```json
262+
Preference-Applied: include-unknown-enum-members
263+
258264
{
259265
"value": [
260266
{
@@ -294,6 +300,8 @@ Preference: include-unknown-enum-members
294300
```
295301

296302
```json
303+
Preference-Applied: include-unknown-enum-members
304+
297305
{
298306
"id": "1",
299307
"displayName": "Secret Prototype",

0 commit comments

Comments
 (0)