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

Serializing also fields and not just properties will make life easier #117

Closed
oscarsan opened this issue Jan 30, 2015 · 5 comments
Closed

Comments

@oscarsan
Copy link

I have an small problem, I'm using structures for 2 purposes, deserialize and serialize from Yaml files but also to download it to a realtime system which needs Marshaled variables. So for example

public struct Configuration
    {
        public NameValue Name;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
        public BoolValue[] AllowedInDirection; 
   }

In this case the BoolValue is something that I need to Marshal in order to been able to download it to the final component. Converting this in a property in order to been able to use the Deserializer and Serializer is quite big work, I will need to create different structures for the realtime component and for the YAML file and that is not go.

So, why not to make this marvelous component so that it will be also possible to serialize a deserialize fields and not just properties inside a class or structure.

@svermeulen
Copy link

This would also play a lot more nicely with Unity since Unity serialization does the opposite (requires that serializable data be in fields and not in properties)

@zatherz
Copy link

zatherz commented May 3, 2017

Bump, need this for https://gitlab.com/zatherz/lyon. At the very least, where should I start implementing this?

@FullStackForger
Copy link

+1 from me here. YamlDotNet is awesome but making it work with unity generates lots of unnecessary work.

@PathogenDavid
Copy link

It is worth pointing out that this is preventing serialization of ValueTuple since they use public fields.

@aaubry
Copy link
Owner

aaubry commented Mar 7, 2019

This has been added to release 5.4.0.

@aaubry aaubry closed this as completed Mar 7, 2019
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

6 participants