You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am decoding a message schema that sends an empty string to represent an unset value. As far as I can tell, there is no way to handle this case without creating a custom type and processing in a decode hook. It could also probably be handled with internal fields that are mapped to duplicate external fields in the post_init method. Either way this complicates struct definition and loses some of the performance benefits of the library.
An optional flag to the decoder could make sense for this feature:
The text was updated successfully, but these errors were encountered:
aolesky
changed the title
Support decoding empty strings as null for Decimal types
Support decoding empty strings as unset for all field types
May 13, 2024
Description
I am decoding a message schema that sends an empty string to represent an unset value. As far as I can tell, there is no way to handle this case without creating a custom type and processing in a decode hook. It could also probably be handled with internal fields that are mapped to duplicate external fields in the post_init method. Either way this complicates struct definition and loses some of the performance benefits of the library.
An optional flag to the decoder could make sense for this feature:
The text was updated successfully, but these errors were encountered: