Fix boolean parsing and make SimpleTypeSerializer
and SimpleTypeDeserializer
public
#826
+275
−241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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