media-io / yaserde

Yet Another Serializer/Deserializer
MIT License
175 stars 57 forks source link

possibility to serialize/deserialize xml tags in strings unchanged #140

Open RustyJoeM opened 2 years ago

RustyJoeM commented 2 years ago

Hello,

i have trouble serializing (and deserializing) the Strings. I'd like to serialize string like "<hello>" into same text, but i keep getting "&lt;hello&gt;".

Is this possible currently with YaSerDe either directly, or with some workaround (excluding hard reverse transform on resulting big xml string where it can affect also original/intended &lt;s / &gt;s)?

I understand the tranform due to html/xml displaying etc., but e.g. use-cases where XML messages are being built/processed on String level require ability to pass around strings without any implicit magic.

(e.g pre-defined XML structure, with general inner payload of huge/nested subtree that is of no interest to be typed on the "client" side)

Thanks for clarification - great work/crate!

MarcAntoine-Arnaud commented 7 months ago

Hi @RustyJoeM ,

Sorry for the delay ! I think it can be possible to add an option in Deserializer.