RReverser / serde-xml-rs

xml-rs based deserializer for Serde (compatible with 1.0+)
https://crates.io/crates/serde-xml-rs
MIT License
270 stars 90 forks source link

Improve Bool parsing and add sequence serialization #48

Closed MarcAntoine-Arnaud closed 7 years ago

oli-obk commented 7 years ago

Sorry, we won't support this. Use serde(deserialize_with) instead. Reasoning: https://github.com/RReverser/serde-xml-rs/pull/18#issuecomment-309452068

farodin91 commented 7 years ago

Also dublicated sequence serialization see #36

MarcAntoine-Arnaud commented 7 years ago

Regarding Boolean, the W3C standard mention ·boolean· can have the following legal literals {true, false, 1, 0}. This is why it can made sense to add it in this library.

oli-obk commented 7 years ago

@RReverser opinions?

RReverser commented 7 years ago

3.2.2.1 Lexical representation An instance of a datatype that is defined as ·boolean· can have the following legal literals {true, false, 1, 0}.

3.2.2.2 Canonical representation The canonical representation for boolean is the set of literals {true, false}.

This is interesting indeed. If that's called a canonical representation by spec, I agree it's a game changer and makes sense to support it by default (assuming we are still able to have helper functions for 0 / 1 and "exists" / "doesn't exist" representations).

RReverser commented 7 years ago

@MarcAntoine-Arnaud Could you please split your commits into two PRs so that we don't mix discussions?