Comments (8)
Oh I see... are you saying this is throwing a CircularReferencesDetectedException
instead of a MultipleReferencesDetectedException
? I can look into that if so. 👍
from home.
@Mike-E-angelo Look like it helps on my side.
Currently it is not generating Exceptions. Thanks.
Please push it into nuget😎
from home.
Wow @UladimirLameyko I am a little shocked here. It appears the reference is not detected at all. Thank you for reporting this I will look into it for you. 👍
from home.
OK @UladimirLameyko I did look into this and we're running into a bit of a limitation here with ExtendedXmlSerializer. Basically, it stems from the classic serializer and empty collections are not emitted. This is what you are running into here with the above code. In this case. if you are using references with collections it is recommended/suggested you initialize with an empty instance, as such:
public class InnerObject
{
public int Id { get; set; }
public string[] Items { get; set; } = Array.Empty<string>();
}
public class InnerObject2
{
public string[] Items { get; set; } = Array.Empty<string>();
}
I concede this is not perfect but poking around any further would introduce breaking changes and/or additional functionality I would not be comfortable introducing at this point with my limitations at the moment.
That stated, I am definitely open to further discussion around this if you have further ideas/considerations/suggestions and even a PR if we can land on one. :)
from home.
@Mike-E-angelo Problem not with empty arrays. Even if I put value into collection
var sameInnerObject = new InnerObject { Id = 100, Items = new string[] { "Some" } };
Exception still appear
Even if I initialize arrays with
public string[] Items { get; set; } = Array.Empty<string>();
from home.
Branch issues/fix/i593 created!
from home.
Alright @UladimirLameyko please try out the build as listed here:
#594 (comment)
And let me know if that works for you. If so I will push this to NuGet. 👍
from home.
Great, sounds good @UladimirLameyko it has been deployed here:
https://www.nuget.org/packages/ExtendedXmlSerializer
I appreciate your continued feedback and cooperation towards improving ExtendedXmlSerializer 👍
An extensible Xml Serializer for .NET that builds on the functionality of the classic XmlSerializer with a powerful and robust extension model.
from home.
Related Issues (20)
- Remove netcoreapp3.1 HOT 2
- Update build keys HOT 2
- Update Documentation Key HOT 2
- Address Warnings HOT 1
- (De)serialization of objects with property-name same as object-name stopped working correctly since V3.2 HOT 11
- Target Instances Remain In Activation HOT 1
- Address Warnings HOT 1
- Dictionary/List serialization issue/question HOT 6
- Sprache.ParseException? HOT 4
- ShouldSerialize is not working. HOT 2
- DateOnly type not serialized HOT 8
- Will Configuration for a base class automatically apply to its derived classes? HOT 13
- Deserialization of inherited class with different namespaces not possible with Migration HOT 8
- Deserialization issue with inherited class with different namespaces and Migration HOT 2
- Update NuGet Key HOT 1
- Update GitHub API Token HOT 1
- API Key HOT 1
- Update Deploy Key HOT 2
- Update Script for RSA HOT 1
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 home.