Skip to content
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

Add transform that can remove invalid defaults #1964

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

mtdowling
Copy link
Member

If a default trait is incompatible with the range trait of the member or the member target, then the shape is essentially in a state where the member is invalid: omit a value for the member at it is automatically incompatible with the range trait of the member.

This transformer finds such cases and removes invalid default values. It is likely that services with such a model did not intend for the members to actually have a default value, and this typically only happens with members that have a default value of 0.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from a team as a code owner September 1, 2023 20:49
@mtdowling mtdowling force-pushed the remove-invalid-default-values branch from 0048c4d to acd19c8 Compare September 1, 2023 21:00
@mtdowling mtdowling changed the base branch from main to improve-number-node September 1, 2023 21:01
@mtdowling mtdowling force-pushed the remove-invalid-default-values branch from acd19c8 to 2bd5c14 Compare September 2, 2023 17:12
@mtdowling mtdowling force-pushed the remove-invalid-default-values branch from 2bd5c14 to 7075eca Compare September 5, 2023 18:48
@mtdowling mtdowling changed the base branch from improve-number-node to main September 5, 2023 18:57
If a default trait is incompatible with the range trait of the member
or the member target, then the shape is essentially in a state where
the member is invalid: omit a value for the member at it is
automatically incompatible with the range trait of the member.

This transformer finds such cases and removes invalid default values.
It is likely that services with such a model did not intend for the
members to actually have a default value, and this typically only
happens with members that have a default value of `0`.
@mtdowling mtdowling force-pushed the remove-invalid-default-values branch from 7075eca to 454a3d3 Compare September 5, 2023 19:00
@mtdowling mtdowling merged commit 86ff69b into main Sep 5, 2023
@mtdowling mtdowling deleted the remove-invalid-default-values branch September 11, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants