I have a schema which I use to generate C# classes out of it.
One issue that I observed was that a schema with an array property of a nullable string enum does not set the ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter), due to IsStringEnumArray returning false, which it does not when I remove the nullable part.
So the first one uses the ActualTypeSchema while the 2nd uses ActualSchema for the item. When I debugged it, I saw that if the latter would use the ActualTypeSchema of the Item, my usecase would work as expected.
Any idea why ActualSchema is used instead of ActualTypeSchema?
Hey
I have a schema which I use to generate C# classes out of it. One issue that I observed was that a schema with an array property of a nullable string enum does not set the
ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter)
, due to IsStringEnumArray returning false, which it does not when I remove the nullable part.Examples:
In the search of what's wrong, I stumbled upon its sibling (IsStringEnum) which interesstingly is slightly differently implemented.
IsStringEnum =>
_property.ActualTypeSchema.IsEnumeration && _property.ActualTypeSchema.Type.IsString()
IsStringEnumArray =>_property.ActualTypeSchema.Item.ActualSchema.IsEnumeration && _property.ActualTypeSchema.Item.ActualSchema.Type.IsString()
So the first one uses the
ActualTypeSchema
while the 2nd usesActualSchema
for the item. When I debugged it, I saw that if the latter would use theActualTypeSchema
of the Item, my usecase would work as expected.Any idea why ActualSchema is used instead of ActualTypeSchema?