-
Notifications
You must be signed in to change notification settings - Fork 237
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 boolean parsing and make SimpleTypeSerializer
and SimpleTypeDeserializer
public
#826
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #826 +/- ##
==========================================
- Coverage 60.21% 60.05% -0.16%
==========================================
Files 41 41
Lines 16021 16031 +10
==========================================
- Hits 9647 9628 -19
- Misses 6374 6403 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…omicDeserializer Content::deserialize_all can be replaced by Content::deserialize_item helper, because when it is used, the self.offset is 0
Helper in CowRef will be reused in next commit
…lean or number Call visit_borrowed_str / visit_str / visit_string instead. It is responsibility of the type to return an error if it is not able to process such data; the deserializer does the conversion only because technically all things in XML stored as strings
ff6153b
to
83d2957
Compare
This PR makes
SimpleTypeSerializer
andSimpleTypeDeserializer
public, as requested in #824. It also includes two other changes.When checking documentation for the
SimpleTypeDeserializer
I noticed, that we parse more boolean representations than described in the XML Schema specification. I do not see much reasons to keep that additional variants anymore, also because of the next implemented change. If you need more representations, you can use the wrapper type or#[serde(deserialize_with)]
attribute.The last change that this PR contains is final transfer of the responsibility of generating errors about mismatched types to the type being deserialized. That means that we no more need
DeError::InvalidInt
,DeError::InvalidFloat
andDeError::InvalidBoolean
errors, so their are removed. The changes can be notified in this code snippet:Before:
After:
Closes #824