Skip to content

Deprecate x-extensible-enum #837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

ePaul
Copy link
Member

@ePaul ePaul commented Apr 29, 2025

Implements #831.

Also some minor changes to clarify things elsewhere.

@ePaul ePaul added guideline-change zally-change major Major feature changes or updates, e.g. feature rollout to a new country, new API calls. labels Apr 29, 2025
Copy link

invalid team ID

The team ID in your .zappr.yaml file does not appear to be valid. Please, fix
this before team ID checks will be added back into ComPR's specification check.

You can follow this guideline for help.

2 similar comments
Copy link

invalid team ID

The team ID in your .zappr.yaml file does not appear to be valid. Please, fix
this before team ID checks will be added back into ComPR's specification check.

You can follow this guideline for help.

Copy link

invalid team ID

The team ID in your .zappr.yaml file does not appear to be valid. Please, fix
this before team ID checks will be added back into ComPR's specification check.

You can follow this guideline for help.

Copy link
Member

@tfrauenstein tfrauenstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR -- LGTM!
I provided some (mostly editorial) change proposals.

There are other occurrences of x-extensible-enum in the following rules that need to be updated:

The Event Type specification: rule #197 also uses x-extensible-enum. However, the rule anyway needs to be cleaned-up -- see Issue: Optimize the Event Guidelines for its usage with Nakadi. So I propose to handle this via a separate PR for the Event Guideline Clean-Up issue.

Additionally, I propose to add a log entry to the Change History.

@@ -124,8 +124,11 @@ Service clients should apply the robustness principle:
http://martinfowler.com/bliki/TolerantReader.html["TolerantReader"] post),
i.e. ignore new fields but do not eliminate them from payload if needed for
subsequent {PUT} requests.
** Be prepared that {x-extensible-enum} return parameters (see <<112, rule 112>>) may deliver new values;
either be agnostic or provide default behavior for unknown values, and do not eliminate them.
** Be prepared that "extensible enum" return parameters (see <<112, rule 112>>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
** Be prepared that "extensible enum" return parameters (see <<112, rule 112>>)
** Be prepared that <<112, extensible enum>> return parameters

** Be prepared that "extensible enum" return parameters (see <<112, rule 112>>)
may deliver new values;
either be agnostic or provide default behavior for unknown values, and
do not eliminate them if needed for subsequent {PUT} requests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
do not eliminate them if needed for subsequent {PUT} requests.
do not eliminate them when passed with subsequent {PUT} requests.

intermediaries (but that was rarely implemented).
It was visible in a few tools (e.g. Swagger UI), but ignored by most others.

An open-ended list of values was specified as follows:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would move this example up after ... with a similar semantic:.


We also thought we could have some validations (e.g. by our event bus Nakadi),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We also thought we could have some validations (e.g. by our event bus Nakadi),
We also thought we could provide validations in our infrastructure

@@ -953,23 +953,29 @@ maintain compatibility as they will not be in a position to serve
versioned media types on demand.

For event schema, these are considered backward compatible changes, as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For event schema, these are considered backward compatible changes, as
For event schema, these are considered full compatible changes, as

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, Nakadi has the three levels of compatibility (compatible, forward, none), while we here only describe the difference between the first two. Not sure if naming these "full compatible" and "incompatible" is the right thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us use the Nakadi wording, i.e. compatible instead of full compatible (= backward and forward compatible). Let us use non-compatibel as opposed to compatible.
Let us avoid defining the other 'compatibility modes' of Nakadi -- will be linked when we do the Nakadi / Guideline clean-up.

* Removing an individual value from an enumeration.
* Adding new value to a {x-extensible-enum} field (see <<112, rule 112>> and <<108, rule 108>>).
* Adding new values to extensible enum fields (see <<112, rule 112>> and <<108, rule 108>>).

These are considered backwards-incompatible changes, as seen by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These are considered backwards-incompatible changes, as seen by
These are considered *in*compatible changes, as seen by

Co-authored-by: Thomas Frauenstein <[email protected]>
@tfrauenstein
Copy link
Member

tfrauenstein commented May 7, 2025

@ePaul I just discovered that 'examples' in OpenAPI 3.0 is not yet consistent with JSON Schema -- this was only fixed with OpenAPI 3.1! In OpenAPI 3.0 examples is a map of named examples, and not simply an array of examples like in JSON Schema. In OpenAPI 3.1 examples in data object schema definitions is done like in JSON Schema (as array), but OpenAPI 3.1 still supports example and examples outside the schema — specifically under the media type object (like application/json) in the 'old way' as map (see working-with-examples ). If we want to stick to OpenAPI 3.0 as status-quo, we need to change the examples. I also created an Issue: OpenAPI 3.1 Upgrade for discussion in the guild.

@ePaul ePaul marked this pull request as draft May 27, 2025 12:52
@ePaul
Copy link
Member Author

ePaul commented May 27, 2025

As OpenAPI 3.0 doesn't have examples in the schema object, we can't really use that before we generally recommend 3.1 (or later). Putting on hold, waiting for #839.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guideline-change major Major feature changes or updates, e.g. feature rollout to a new country, new API calls. zally-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants