-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Support for Flattening #1179
Merged
Merged
Support for Flattening #1179
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
5a91ac5
Initial work on supporting structs as map with unknown field collection
mitsuhiko b4dbae2
Added support for serialization of structs as maps
mitsuhiko 39413c8
Implement deserializer for map mode and collection fields
mitsuhiko 1bd2c61
Explicitly pass value requirements for the capture path
mitsuhiko 77b07f3
Added tests for unknown_fields_into
mitsuhiko 07d0734
Make clippy happy
mitsuhiko 583c0d8
Make proc-macro2/nightly happy
mitsuhiko 299cd2d
Replace unknown_fields_into with serde(flatten)
jan-auer 571bb8c
Derive serialization for serde(flatten)
jan-auer 5ae06bb
Store flatten flag in container attributes
jan-auer 6627540
Added support basic deserialization in derive
jan-auer 5457394
Fixed various issues with combinding flatten and deny_unknown_fields
jan-auer 9e8cda4
Added basic not fully working FlatMapSerializer
mitsuhiko b692923
Non working changes to the flatten serializer
mitsuhiko 112dfd7
Correctly suppress the end() call for flattened serialization
mitsuhiko ebf80ac
Implement deserialization support for flatten
mitsuhiko b4ef7ac
Updated tests for flatten
mitsuhiko d1833c5
Added support for basic enums in flatten
mitsuhiko a8c8c20
Added support for struct variant enum serialization
mitsuhiko b8602a7
Added test for tag/content enum flattening
mitsuhiko 49e302d
Improved error message for flattening on unsupported types
mitsuhiko 352fe7b
Removed an unused field that was left over from a merge conflict
mitsuhiko ca41e16
Added some missing conditionals for feature compilation
mitsuhiko bfdcbae
Fixed an unused import error
mitsuhiko 2f57cec
format! -> format_args! for an error message
mitsuhiko ffcde25
Fixed some clippy warnings
mitsuhiko ebc61ba
Added newtype struct support for flattening
mitsuhiko f1af2dc
Added support for newtype variant serialization
mitsuhiko 61b167b
Attempted support for in_place deserialization for structs as map
mitsuhiko d44f129
Do not emit an in-place deserialization path for struct as map
mitsuhiko 58d52e7
Remove #[serde(repr = "map")]
mitsuhiko ad40f97
Switch to using Content keys internally for flattening to later suppo…
mitsuhiko 205f606
Various clippy fixes
mitsuhiko c5a3128
Added a more complex flattening test
mitsuhiko 7cf1846
Use more consistent error messages for bad flattening
mitsuhiko f02dbf3
Added non string key support for flattening
mitsuhiko 7c596c7
Remove unnecessary as_str
mitsuhiko 6e324e8
Some refactoring to use a bit less unwrap()
mitsuhiko abeea89
Fully qualify some calls in generated code and fix a bad comment
mitsuhiko 8637dda
Refactored a test
mitsuhiko 5b884b5
Added some missing UFCs
mitsuhiko 50c636a
Remove now dead as_map detection (can be cattrs.has_flatten)
mitsuhiko 695c3ee
Do not imply flatten from skip_serialize
mitsuhiko e4ef087
Added support for borrowing when flattening
mitsuhiko 1d92569
Added explanatory comment about fetching data from buffered content
mitsuhiko 96393bf
Added checks for flatten attribute
mitsuhiko bb2ecb3
Added compilefail tests for flatten conflicts
mitsuhiko 99614c7
Added flatten on enum compile fail test
mitsuhiko 27f935f
Correctly serialize newtype variants for flatten
mitsuhiko 0fde3c2
Fix a warning caused by no-default-features
mitsuhiko 3d647f4
Fixed a compilefail test for flatten on enums
mitsuhiko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find this logic hard to follow, can you at least add some comments so future contributors know what's going on