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

fix: Add default values on decoding for ResolveResponse #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fabriziodemaria
Copy link
Member

@fabriziodemaria fabriziodemaria commented Feb 7, 2025

Missing values from JSON should map to default values (i.e. empty) for value variant and flagSchema

@fabriziodemaria fabriziodemaria changed the title Add default values on decoding for ResolveResponse fix: Add default values on decoding for ResolveResponse Feb 7, 2025
@fabriziodemaria fabriziodemaria force-pushed the default-values-json branch 2 times, most recently from 7e2b7c3 to 975f02c Compare February 7, 2025 15:45
case flag, value, variant, flagSchema, reason
}

init(
Copy link
Member

Choose a reason for hiding this comment

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

Do I understand correctly that this function will throw if flag and reason is not set but will return correctly if other fields being missing?

How come we make this change now? What prompted it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this change came from trying out a different version of our backend resolver that would return no entries in the JSON rather than empty ones, in some cases

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