-
Notifications
You must be signed in to change notification settings - Fork 128
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
Struct with flatten field serialized as JSON, but not as struct #548
Comments
This is unfortunately When a struct contains any flattened fields, |
I just ran into this myself. It's disappointing to not be able to use Has there been any consideration for allowing RON's map syntax I understand this might not fully align with the intention of the syntax having an explicit distinction between structs and maps, but I might think of it as "maps with string keys can be treated as structs of anonymous type". |
Do you mean during serialization (unfortunately impossible since serde doesn't give us any information) or during deserialization (should already be working on the 0.9 pre-release version)? |
Thanks for pointing that out, I didn't think of trying the latest I did run into a separate bug while trying that out, so I've opened an issue ticket for that: #555 |
Struct without flatten field serialized as struct:
Result:
Struct containing flatten field serialized as JSON:
Result:
May be it would be better to see it as (literally ignore the flatten attribute for the fields on serialization may be optionally):
The text was updated successfully, but these errors were encountered: