Skip to content

Commit c1e8eb1

Browse files
ePaultfrauenstein
andauthored
Code review suggestions
Co-authored-by: Thomas Frauenstein <[email protected]>
1 parent 8d935cd commit c1e8eb1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

chapters/compatibility.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Service clients should apply the robustness principle:
128128
may deliver new values;
129129
either be agnostic or provide default behavior for unknown values, and
130130
do not eliminate them if needed for subsequent {PUT} requests.
131-
(This means you can't simply map it to a limited enumeration type like a Java `enum`.)
131+
(This means you cannot simply implement it by using a limited enumeration type like a Java `enum`.)
132132
** Be prepared to handle HTTP status codes not explicitly specified in endpoint
133133
definitions. Note also, that status codes are extensible. Default handling is
134134
how you would treat the corresponding {x00} code (see
@@ -297,7 +297,7 @@ level data structures, since they don't support compatible, future extensions.
297297
JSON schema `enum` is per definition a closed set of values that is assumed to be
298298
complete and not intended for extension. This means, extending the list of values of
299299
`enum` is considered an incompatible change, and needs to be aligned with all consumers
300-
as other incompatible changes.
300+
like other incompatible changes.
301301

302302
To avoid these issues, we recommend to use `enum` only if
303303

@@ -308,10 +308,10 @@ To avoid these issues, we recommend to use `enum` only if
308308

309309
In all other cases, where additional values are imaginable our recommendation is this:
310310

311-
* Use `examples` with the list of currently known values
311+
* Use `examples` with the list of (currently known) values
312312
* Put "Extensible enum" in the description.
313313

314-
This indicates that currently these listed values will be possible, but
314+
This indicates that only the listed values are currently possible, but
315315
consumers need to be aware that this list can be extended without notice
316316
(see below for details).
317317

@@ -335,13 +335,13 @@ See <<240>> about enum value naming conventions.
335335
fallback / default behavior for unknown new values, see <<108>>.
336336
* API owners must take care to extend these extensible enums in a compatible way, i.e.
337337
not changing the semantics of already existing / documented values.
338-
* For uses in input, API implementations should validate the values and only accept
339-
values listed in `examples`. The list should not be reduced (that would be an incompatible change).
340-
* Before additional values are accepted or returned, API owners should extend
338+
* API implementations should validate the values provided with the input payload and only accept
339+
values listed in `examples`. The list should not be reduced for inputs (that would be an incompatible change).
340+
* Before additional values are accepted or returned, API owners should update the API description and extend
341341
the `examples` list, see <<107>>.
342342

343343
(Note that the last 3 bullet points do not apply for uses of `examples` _without_ the
344-
"Extensible enum" marker in the description – here any value at all needs
344+
"Extensible enum." prefix in the description – here any value needs
345345
to be expected.)
346346

347347
=== Historic Note
@@ -378,4 +378,4 @@ JSON schema had neither).
378378

379379
We also thought we could have some validations (e.g. by our event bus Nakadi),
380380
but the Nakadi team instead decided to not validate `x-extensible-enum`,
381-
and even reject it in schema definitions.
381+
and even reject it in event type schema definitions.

0 commit comments

Comments
 (0)