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
Rewrite serializer #490
Rewrite serializer #490
Commits on Oct 23, 2022
-
Correctly test
deserialize_ignored_any
for simple type deserializersWe expect that `deserialize_any` was called for a type. The wrapper type is only required to add a PartialEq trait for use in assert_eq!, so we add a #[serde(transparent)]
-
Replace HEX escape codes in tests with decimal codes to be compatible…
… with serializer Roundtrip with serializer will be added soon
-
Remove excess tests, that already covered by other tests more systema…
…tically That cases already covered by tests in tests/serde-de.rs in `seq` and `struct_` modules
-
-
Do not allow serialize unit structs as XML names. We never use struct…
… name as a data, except in the root serializer
-
Introduce internal
XmlName
struct to validate serialized names agai……nst XML rules for names https://www.w3.org/TR/xml11/#NT-Name
-
-
Implement SimpleTypeSerializer that used for serializing content of a…
…ttributes and text nodes
-
Remove
$unflatten=
prefix, introduced in tafia#298This prefix just does nothing. Deserialzier already works as with them, out-of-box. Support for namespaces will be done in another PR This commit reverts 8cd971e Removed tests covered by following existing tests: - test_parse_unflatten_field - serde-de::struct_::elements - test_issue305_unflatten_namespace - serde-de::struct_::namespaces - test_issue305_unflatten_nesting - serde-de::nested_struct Fixes tafia#430
Commits on Oct 26, 2022
-
- `$text` serialized as a simple type - `$value` serialized as an element with name that depends from value instead of key - Text or CDATA elements deserialized as `$value` field, if that field is expected, and as `#text` field, if not expected - any not-listed in known fields elements deserialized as a `$value` field, if that field is expected doc-test failures (2): src\de\mod.rs - de (line 139) src\de\mod.rs - de (line 36) Co-authored-by: Daniel Alley <dalley@redhat.com>
-
Implement ElementSerializer which can store object as an XML tree. Fix …
…tafia#252 Still 2 doc-test failures
-
Implement indentation for new serializer. Fix tafia#361
Still 2 doc-test failures
-
Change expectations about results of serializing
Serialization to attributes would be done only when field explicitly marked as an attribute failures (21): with_root::enum_::adjacently_tagged::flatten_struct with_root::enum_::adjacently_tagged::nested_struct with_root::enum_::adjacently_tagged::newtype with_root::enum_::adjacently_tagged::struct_ with_root::enum_::adjacently_tagged::text with_root::enum_::adjacently_tagged::tuple_struct with_root::enum_::adjacently_tagged::unit with_root::enum_::externally_tagged::nested_struct with_root::enum_::externally_tagged::struct_ with_root::enum_::externally_tagged::text with_root::enum_::internally_tagged::nested_struct with_root::enum_::internally_tagged::newtype with_root::enum_::internally_tagged::struct_ with_root::enum_::internally_tagged::text with_root::enum_::internally_tagged::unit with_root::enum_::untagged::nested_struct with_root::enum_::untagged::struct_ with_root::enum_::untagged::text with_root::nested_struct with_root::struct_ with_root::text
-
Add tests for serialization of primitives
This commit changes expectations from serializing primitives - they should be wrapped in root tag failures (53): with_root::char_amp with_root::char_apos with_root::char_gt with_root::char_lt with_root::char_non_escaped with_root::char_quot with_root::char_space with_root::enum_::adjacently_tagged::flatten_struct with_root::enum_::adjacently_tagged::nested_struct with_root::enum_::adjacently_tagged::newtype with_root::enum_::adjacently_tagged::struct_ with_root::enum_::adjacently_tagged::text with_root::enum_::adjacently_tagged::tuple_struct with_root::enum_::adjacently_tagged::unit with_root::enum_::externally_tagged::nested_struct with_root::enum_::externally_tagged::primitive_unit with_root::enum_::externally_tagged::struct_ with_root::enum_::externally_tagged::text with_root::enum_::internally_tagged::nested_struct with_root::enum_::internally_tagged::newtype with_root::enum_::internally_tagged::struct_ with_root::enum_::internally_tagged::text with_root::enum_::internally_tagged::unit with_root::enum_::untagged::nested_struct with_root::enum_::untagged::newtype with_root::enum_::untagged::struct_ with_root::enum_::untagged::text with_root::enum_::untagged::unit with_root::f32_ with_root::f64_ with_root::false_ with_root::i128_ with_root::i16_ with_root::i32_ with_root::i64_ with_root::i8_ with_root::isize_ with_root::map with_root::nested_struct with_root::option_some with_root::seq with_root::str_escaped with_root::str_non_escaped with_root::struct_ with_root::text with_root::true_ with_root::u128_ with_root::u16_ with_root::u32_ with_root::u64_ with_root::u8_ with_root::unit with_root::usize_
-
Copy all serializer tests to test serializer in mode without root tag…
… specified Now serializer tested in both modes: with and without root tag specified failures (114): with_root::char_amp with_root::char_apos with_root::char_gt with_root::char_lt with_root::char_non_escaped with_root::char_quot with_root::char_space with_root::enum_::adjacently_tagged::empty_struct with_root::enum_::adjacently_tagged::flatten_struct with_root::enum_::adjacently_tagged::nested_struct with_root::enum_::adjacently_tagged::newtype with_root::enum_::adjacently_tagged::struct_ with_root::enum_::adjacently_tagged::text with_root::enum_::adjacently_tagged::tuple_struct with_root::enum_::adjacently_tagged::unit with_root::enum_::externally_tagged::nested_struct with_root::enum_::externally_tagged::primitive_unit with_root::enum_::externally_tagged::struct_ with_root::enum_::externally_tagged::text with_root::enum_::internally_tagged::empty_struct with_root::enum_::internally_tagged::nested_struct with_root::enum_::internally_tagged::newtype with_root::enum_::internally_tagged::struct_ with_root::enum_::internally_tagged::text with_root::enum_::internally_tagged::unit with_root::enum_::untagged::nested_struct with_root::enum_::untagged::newtype with_root::enum_::untagged::struct_ with_root::enum_::untagged::text with_root::enum_::untagged::unit with_root::f32_ with_root::f64_ with_root::false_ with_root::i128_ with_root::i16_ with_root::i32_ with_root::i64_ with_root::i8_ with_root::isize_ with_root::map with_root::nested_struct with_root::option_some with_root::seq with_root::str_escaped with_root::str_non_escaped with_root::struct_ with_root::text with_root::true_ with_root::u128_ with_root::u16_ with_root::u32_ with_root::u64_ with_root::u8_ with_root::unit with_root::usize_ without_root::char_amp without_root::char_apos without_root::char_gt without_root::char_lt without_root::char_non_escaped without_root::char_quot without_root::char_space without_root::enum_::adjacently_tagged::empty_struct without_root::enum_::adjacently_tagged::flatten_struct without_root::enum_::adjacently_tagged::nested_struct without_root::enum_::adjacently_tagged::newtype without_root::enum_::adjacently_tagged::struct_ without_root::enum_::adjacently_tagged::text without_root::enum_::adjacently_tagged::tuple_struct without_root::enum_::adjacently_tagged::unit without_root::enum_::externally_tagged::nested_struct without_root::enum_::externally_tagged::primitive_unit without_root::enum_::externally_tagged::struct_ without_root::enum_::externally_tagged::text without_root::enum_::internally_tagged::empty_struct without_root::enum_::internally_tagged::flatten_struct without_root::enum_::internally_tagged::nested_struct without_root::enum_::internally_tagged::newtype without_root::enum_::internally_tagged::struct_ without_root::enum_::internally_tagged::text without_root::enum_::internally_tagged::unit without_root::enum_::untagged::flatten_struct without_root::enum_::untagged::nested_struct without_root::enum_::untagged::newtype without_root::enum_::untagged::struct_ without_root::enum_::untagged::text without_root::enum_::untagged::tuple_struct without_root::enum_::untagged::unit without_root::f32_ without_root::f64_ without_root::false_ without_root::flatten_struct without_root::i128_ without_root::i16_ without_root::i32_ without_root::i64_ without_root::i8_ without_root::isize_ without_root::map without_root::nested_struct without_root::seq without_root::str_escaped without_root::str_non_escaped without_root::struct_ without_root::text without_root::true_ without_root::tuple without_root::u128_ without_root::u16_ without_root::u32_ without_root::u64_ without_root::u8_ without_root::unit without_root::usize_
-
Removed tests, that became duplicates of new tests:
- serialize_bool - duplicate of `without_root::false_` and `without_root::true_` - serialize_struct - duplicate of `without_root::struct_` - serialize_struct_value_number - duplicate of `without_root::value` - serialize_struct_value_string - excess test, duplicate of previous - serialize_enum - duplicate of `without_root::enum_::externally_tagged::newtype` - serialize_a_list - non working test that replaced by `without_root::seq` - test_empty - duplicate of `without_root::empty_struct` - test_nested - duplicate of `without_root::nested_struct` Still 114 failures
-
-
Change expectations about deserializing attributes
failures (40): enum_::adjacently_tagged::flatten_struct::attributes enum_::adjacently_tagged::nested_struct::attributes enum_::adjacently_tagged::newtype::attributes enum_::adjacently_tagged::struct_::attributes enum_::adjacently_tagged::unit::attributes enum_::externally_tagged::flatten_struct::attributes enum_::externally_tagged::nested_struct::attributes enum_::externally_tagged::struct_::attributes enum_::internally_tagged::flatten_struct::attributes enum_::internally_tagged::nested_struct::attributes enum_::internally_tagged::struct_::attributes enum_::internally_tagged::unit::attributes enum_::untagged::flatten_struct::attributes enum_::untagged::nested_struct::attributes flatten_struct::attributes from_str_should_ignore_encoding nested_struct::attributes seq::fixed_name::fixed_size::list_of_struct seq::fixed_name::variable_size::list_of_struct seq::top_level::list_of_struct struct_::attribute_and_element struct_::attributes struct_::excess_attributes xml_schema_lists::attribute::bool_ xml_schema_lists::attribute::byte_buf xml_schema_lists::attribute::char_ xml_schema_lists::attribute::f32_ xml_schema_lists::attribute::f64_ xml_schema_lists::attribute::i128_ xml_schema_lists::attribute::i16_ xml_schema_lists::attribute::i32_ xml_schema_lists::attribute::i64_ xml_schema_lists::attribute::i8_ xml_schema_lists::attribute::string xml_schema_lists::attribute::u128_ xml_schema_lists::attribute::u16_ xml_schema_lists::attribute::u32_ xml_schema_lists::attribute::u64_ xml_schema_lists::attribute::u8_ xml_schema_lists::attribute::unit
-