fix: custom Type serialization methods #209
Closed
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.
Summary for #199 and Proposed Solutions
Original Problem
to_json
method ofType
works as expected, butto_xml
does not.<tag time="2012"/>
, serialization relies only onto_s
or a raw string, which is insufficient for certain use cases (e.g., custom serialization for specific types). Fix specs reqif#1from_{format}
methods ofType
(e.g.,from_xml
,from_json
) do not function as expected. While this issue isn't directly addressed in this PR, tests have been included to document the problem (currently commented out).Changes Introduced in This PR
1. Added Specs for Issue #199
to_xml
andto_json
overrides:Ceramic
andHighPrecisionDateTime
to demonstrate correct serialization/deserialization as part of the documentation (e.g., inREADME.md
).2. Applied
serialize
in Three AreasConsiderations and Next Steps
from_{format}
methods (e.g.,from_xml
,from_json
) ofType
are still not functioning as intended. Tests documenting this issue are included but commented out.