Open Develeon64 opened 7 months ago
The way the pre-built typeinspectors are setup is that it just reads the properties/fields on the object, itself, it doesn't take into account whether the field/property is from the inherited types or not, so you'll need to build your own, here's a link to the prebuilt type converter to give you a starting point, it's pretty easy to implement.
You could also use the YamlMember
attribute and set the order on your classes, kind of a pain, but it would work.
Hello there!
The question in short is: Can I change to order, so the members of inherited classes get serialized first, without manually sorting everything?
More info: I want to use YAML to configure my app. Every time I read the configuration file I write the just read contents back to normalize it. For my logger I have a base class defining two members, that every logger should have:
And now I'm using this to define the default behavior of all loggers and 3 specific ones:
When serializing this the inherited members are placed behind every other members. But I'd like them to be always at the top.
Instead of
Can I achieve this in a quick and simple way without creating a custom SortedTypeInspector?