Comments (3)
Reproduced in unit testing here: roji@7642951
The problem is that when EmitDefaults is false (the default), the DefaultExclusiveObjectGraphVisitor skips all nulls/defaults, regardless of whether they're in a collection or not.
I think it is difficult to resolve this issue with the current design, where default exclusion happens in a visitor (which has no context of where it is in the object graph. In roji@9fe1e94, I moved the default exclusion logic from the visitor to the TraversalStrategy, where much more context is available. I think that would be the correct solution to this bug as well.
The other alternative is to track graph context information inside the visitor (based on calls to VisitSequenceStart, VisitMappingStart), but that seems needless and complicated to me...
If you're OK with moving the default exclusion logic to the TraversalStrategy, I can submit a pull request fixing this.
from yamldotnet.
Actually this one was a simple bug in the visitor. It has been fixed on commit e9019d5.
from yamldotnet.
Oops, missed that...
from yamldotnet.
Related Issues (20)
- Polymorphic deserialization - Alias $example_word cannot precede anchor declaration HOT 4
- DateTime fails Serialization/Deserialization roundtrip when JsonCompatible is on HOT 5
- Serialization/Deserialization vs strings with funny characters HOT 8
- How do I use this with multiple documents of arbitrary types? HOT 3
- YamlMember Alias usage HOT 4
- RobiniaDocs API Explorer HOT 1
- Add support for including types defined in another assembly in static code generation HOT 1
- Static code generation fails to generate code for Dictionary and List which use Array values
- Type descriminator keys and casing HOT 4
- Enum serialization behavior changed after #856 HOT 1
- Property 'access-points' not found on type ... HOT 4
- Disable serialization for specific types
- The serializer serialitzes wrong the string arrays HOT 3
- Incorrect handling of carriage return `\r` and tab `\t` HOT 6
- Add quotes for strings on model serialization HOT 3
- Order for inheritance HOT 2
- Add new line between items
- yaml.Documents[].RootNode is YamlScalarNode instead of YamlMappingNode in VS2022 console project HOT 6
- Deserializing multiple documents does not work HOT 2
- Problem Deserializing a list of player HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yamldotnet.