-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Option to serialize members of base types first #984
Comments
To keep this change simple I'll just remove sealed and make the type protected for now. |
n9
pushed a commit
to n9/YamlDotNet
that referenced
this issue
Sep 27, 2024
…and WritablePropertiesTypeInspector + add virtual method CreateProperty to PropertiesTypeInspector and PropertyInfo to ReflectionPropertyDescriptor for aaubry#984
@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: #987 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
.YamlDotNet/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs
Line 33 in 485daaa
YamlDotNet/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs
Line 63 in 485daaa
And 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
.YamlDotNet/YamlDotNet/Serialization/TypeInspectors/WritablePropertiesTypeInspector.cs
Line 33 in 485daaa
The text was updated successfully, but these errors were encountered: