Skip to content

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 3 times, most recently from 975f02c to ffca181 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

@fabriziodemaria fabriziodemaria force-pushed the default-values-json branch 2 times, most recently from f6bff86 to 65f1a16 Compare July 1, 2025 20:38
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.

3 participants