aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.48k stars 466 forks source link

Fix code generation for Dictionary and List which use Array values #855

Closed prochnowc closed 9 months ago

prochnowc commented 9 months ago

Fixes #854

prochnowc commented 9 months ago

@EdwardCooke I have another fix for static code generation prepared, so please do not do a release immediately ;)

EdwardCooke commented 9 months ago

Sounds good. I’ll try and get to it as soon as your ready.

prochnowc commented 9 months ago

Should I put the fix in this PR or do another one ? It is about deserializing into object (which already uses Dictionary<object, object> without static code generation)

EdwardCooke commented 9 months ago

It doesn’t always go into a dictionary. You can serialize/deserialize just a single value like an int or string. Also, you won’t know what the type of the object should be so it doesn’t know what to deserialize into which is why it throws an exception there. There was another case where it couldn’t figure it out back when I built out the static stuff and I can’t remember exactly what it is. I very vaguely remember it had something to do with dictionary object, object not working right in aot compiled applications. Might be way off there though.

did you find a way around those object limits?

prochnowc commented 9 months ago

At least I managed to deserialize object into Dictionary<object,object> with AOT. I will open annother issue about that, this PR doesnt seem to be the right place to discuss this. :)

EdwardCooke commented 9 months ago

Sounds good to me. Do you want me to merge this in then?

prochnowc commented 9 months ago

Yes please.

EdwardCooke commented 9 months ago

Will do

aaubry commented 9 months ago

This feature has been released in version 13.5.2.