Commit Graph

31 Commits

Author SHA1 Message Date
Marc-Antoine Arnaud
a067b85ee2 feat: handle same field name but different namespace
issue #186
2024-08-31 16:54:53 +02:00
Marc-Antoine Arnaud
9c2d04b0af fix: support attribute and field with same name 2024-02-03 08:13:39 +01:00
Marc-Antoine Arnaud
0578b73c8a refactor: fix fmt and clippy based on contributions 2024-01-03 17:44:53 +01:00
Marc-Antoine ARNAUD
6f434c84cd
Merge pull request #169 from jondo2010/fix_field_from_pathsegment
Make `From<PathSegment> for Field` handle a corner case
2024-01-03 17:42:04 +01:00
Marc-Antoine Arnaud
04396aafb2 refactor: fix fmt and clippy 2024-01-03 17:38:52 +01:00
John Hughes
99a7323745 Make From<PathSegment> for Field handle a corner case 2024-01-02 23:01:37 +01:00
John Hughes
9c5b993c84 Support deserializing xst xs:list attributes as Vec types. 2023-12-23 21:47:40 +01:00
Marc-Antoine Arnaud
a9b7aa2546 refactor: improve code based on clippy 2023-12-19 22:17:30 +01:00
Marc-Antoine ARNAUD
4444d3f507
Merge pull request #133 from amy-keibler/131-skip-serializing
Add "skip_serializing" attribute
2022-03-25 10:06:14 +01:00
Ephraim Kunz
7148ec67c5 Fix clippy warnings and build with heck 0.4 2022-01-07 08:39:25 -08:00
Amy Keibler
14dcfc43d7 Add "skip_serializing" attribute
If it is present on a field, that field should not be included in the output
If both "skip_serializing" and "skip_serializing_if" are present,
"skip_serializing" should take precedent.
2022-01-06 11:26:32 -05:00
Marc-Antoine ARNAUD
29261a3590
Merge pull request #108 from olvyko/add-skip-ser-if
Add skip_serializing_if support for attributes
2021-05-31 10:45:35 +02:00
Marc-Antoine Arnaud
1fb21c2bf6 minor updates regarding clippy analysis 2021-05-31 08:27:43 +02:00
olvyko
0139d63f6d Alter yaserde_derive crate to support skip_serialize_if for attributes 2021-04-29 21:39:47 +06:00
Jonas Platte
a1fc2f9fad
Revert parts of "Use absolute paths in generated code"
to restore compatibility with older versions of Rust.
2020-12-17 18:32:06 +01:00
Jonas Platte
c455f12d23
Drop unnecessary qualification of String outside of generated code 2020-12-17 17:50:16 +01:00
Jonas Platte
d3ee4112e3
Clean up visitor code generation 2020-12-17 17:50:16 +01:00
Jonas Platte
12ddcdbc87
Use absolute paths in generated code
With this, the derives should work with most of the crates and types
the generated code refers to being aliased.

Notably, methods are still mostly invoked using regular method syntax
so those coming from trait could still be aliased by outside code.
2020-12-17 17:50:16 +01:00
Jonas Platte
52fb60ec8b
Remove most extern crate statements from yaserde_derive
yaserde_derive is an edition 2018 crate, so these are not necessary.
2020-12-17 17:48:26 +01:00
marcelbuesing
798455faa8
Avoid breaking keywords in labels.
Keywords such as `ref` previously lead to labels such as `__#ref__value`.
This should be `__ref__value`.
2020-10-07 10:13:52 +02:00
marcelbuesing
701b92a2a4
Enforce std String in macros to avoid collisions 2020-08-03 20:28:53 +02:00
Marc-Antoine Arnaud
ad167a74a7 use unwrap_or_default 2020-06-08 10:45:18 +02:00
Aaron Hill
6732d8b38a
Handle nested syn::Type:::Group
Currently, rustc does not pass the exact original TokenStream to
proc-macros in several cases. This has many undesirable effects, such as
losing correct location information in error message.
See rust-lang/rust#43081 for more details

In the future, rustc will begin passing the correct TokenStream to
proc-macros. As a result, `syn` may wrap a type in one or more
`syn::Type::Group`s (if the proc-macro input came from a `macro_rules!` expansion).

I've determined that this can cause `yaserde-derive` to fail to match
a `Type::Path`. This PR should properly handle nested groups, allowing
your crate to work with both old and new input.

If you have any questions, feel free to ask me. See rust-lang/rust#72622
for more details.
2020-05-31 00:00:06 -04:00
Marc-Antoine Arnaud
10f2be69be format code 2020-05-20 17:38:31 +02:00
Marc-Antoine Arnaud
0d2058ddb4 use heck to force camel case format on Visitor ident
issue #77
2020-05-20 16:58:55 +02:00
Marc-Antoine Arnaud
dfaa69071d fix namespace check on deserilization of enum 2020-04-29 19:13:32 +02:00
Marc-Antoine Arnaud
e2a2779f71 format code 2020-04-22 19:05:13 +02:00
Marc-Antoine Arnaud
975baabd76 remove root attribute, use rename 2020-04-22 19:04:43 +02:00
Marc-Antoine Arnaud
0872461c41 continue to refactor code using common Field structure 2020-04-22 18:18:11 +02:00
Marc-Antoine Arnaud
f69d5e75b3 implement common default skip content serializer 2020-04-21 18:01:03 +02:00
Marc-Antoine Arnaud
04ddaa29dc restructure code 2020-04-21 15:02:34 +02:00