Closed n9 closed 2 months ago
To keep this change simple I'll just remove sealed and make the type protected for now.
@EdwardCooke Thank you!
I realized that I still need to copy part of code to achieve ordering (as some members are private). I try to address this by PR: https://github.com/aaubry/YamlDotNet/pull/987
Is your feature request related to a problem? Please describe. Members are serialized in the order returned by reflection, with members of base types coming last, which is sometimes not desirable.
Describe the solution you'd like Remove sealed from
ReadablePropertiesTypeInspector
and and fromReflectionPropertyDescriptor
. https://github.com/aaubry/YamlDotNet/blob/485daaa7fa2a9fdc5863294ef580b880aac6a4df/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs#L33 https://github.com/aaubry/YamlDotNet/blob/485daaa7fa2a9fdc5863294ef580b880aac6a4df/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs#L63And extract
ReflectionPropertyDescriptor
to a top-level class (see Additional context), or make protected.Describe alternatives you've considered Copy/paste
ReadablePropertiesTypeInspector
and tweak the order.Additional context
WritablePropertiesTypeInspector
can be also later refactored to share code withReadablePropertiesTypeInspector
. https://github.com/aaubry/YamlDotNet/blob/485daaa7fa2a9fdc5863294ef580b880aac6a4df/YamlDotNet/Serialization/TypeInspectors/WritablePropertiesTypeInspector.cs#L33