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

Handling of empty values #81

Merged
merged 4 commits into from
Feb 17, 2024
Merged

Handling of empty values #81

merged 4 commits into from
Feb 17, 2024

Conversation

alexejk
Copy link
Owner

@alexejk alexejk commented Feb 17, 2024

Adding support in decoder to handle empty response values.

As per specification, <struct /> and <array /> are invalid, thus only handling cases below and mapping them to default values:

Value Default Value
<string/> ""
<int/>, <i4/> 0
<boolean/> false
<double/> 0.0
<dateTime.iso8601/> time.Time{}
<base64/> nil
<array><data/><array> nil

Fixes #80

Copy link

codecov bot commented Feb 17, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (8c0fd9a) 75.60% compared to head (6fd64e7) 77.52%.

Files Patch % Lines
decode.go 91.48% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
+ Coverage   75.60%   77.52%   +1.92%     
==========================================
  Files           7        7              
  Lines         541      565      +24     
==========================================
+ Hits          409      438      +29     
+ Misses        101       96       -5     
  Partials       31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@alexejk alexejk merged commit 7e4e933 into master Feb 17, 2024
4 checks passed
@alexejk alexejk deleted the empty-values branch February 17, 2024 19:31
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.

Unable to decode empty strings properly
1 participant