YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

Common parts extracted + more changes for #984

Open n9 opened this issue 1 year ago • 1 comments

Common parts from ReadablePropertiesTypeInspector and WritablePropertiesTypeInspector are extracted to PropertiesTypeInspector and more changes to support #984:

  • virtual method PropertiesTypeInspector.CreateProperty
  • public property ReflectionPropertyDescriptor.PropertyInfo

n9 avatar Sep 27 '24 07:09 n9

PS: During the refactoring I found that the type inspectors might need more refactoring:

The ReadableAndWritablePropertiesTypeInspector only checks if properties are writable, but despite its name it does not check if they are readable.

https://github.com/aaubry/YamlDotNet/blob/7923dd8e600f7fea7710f3b45f3fadcfa1aa589c/YamlDotNet/Serialization/TypeInspectors/ReadableAndWritablePropertiesTypeInspector.cs#L44-L48

Maybe it should be renamed to something like WritablePropertiesTypeInspectorFilter? (But that would be a breaking change.)

Do you want to create an issue for this?

n9 avatar Sep 27 '24 08:09 n9