Introduce deprecated annotations#6
Open
raginpirate wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
Open
Introduce deprecated annotations#6raginpirate wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
raginpirate wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
Conversation
12 tasks
26a3294 to
f846aa8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds first-class support for field deprecation with explicit transition semantics. This enables schema authors to signal upcoming breaking changes while preserving backwards compatibility during the transition period.
Motivation
When evolving APIs, transitions like
required → optionalorrequired → omitare breaking changes that affect different parties:required → optional): Receivers must update to handle absenceoptional → required): Senders must update to always include the fieldPreviously, there was no way to express "this field is currently required but will be removed" in a machine-readable way.
Changes
Introduces four new visibility values that encode both current runtime behaviour AND the target state:
deprecated_required_to_optionaldeprecated_required_to_omitdeprecated_optional_to_omitdeprecated_optional_to_requiredWhy do we need 4 states instead of 1 or 2?
Theres two limitations at play that lead to this outcome:
The naming convention
deprecated_{current}_to_{target}makes the transition explicit and self-documenting.