Skip to content
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

Derived classes serialization with YamlDotNet.UnitTests.RepresentationModel #14

Closed
pjmolina opened this issue Feb 28, 2013 · 1 comment

Comments

@pjmolina
Copy link

I am facing the following serialization requirement: using the representation model, serialize a List<AbstractBaseClass>. Serialization should manage the different derived classes on runtime.

I wrote a test case to exemplify it.
Please see: http://pastebin.com/gTfAx80G

I am thinking that a solution like adding YamlInclude attribute would get it working in the same way as XML de/serializers uses XmlInclude, and probably a good chance to use YAML tags in action.

What do you think?

Thanks for work great work on YamlDotNet Antonie. Keep pushing!

@aaubry
Copy link
Owner

aaubry commented May 29, 2013

This problem is now being discussed on Issue #26. It is to be expected that there will be a fix soon. I will close this issue.

@aaubry aaubry closed this as completed May 29, 2013
roji pushed a commit to roji/YamlDotNet that referenced this issue May 30, 2013
Previously, serialization happened according to the properties's
declared type. This created problems for cases where the actual value
type differed from the declared type (polymorphism, ints boxed as
objects...).

Closes aaubry#26, aaubry#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants