Open Yoztastic opened 2 months ago
https://github.com/RicoSuter/NJsonSchema/wiki/Inheritance
Using System.Text.Json
[JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] as advised above does not compile for the reason JsonConverter constructor takes a single parameter.
[JsonConverter(typeof(JsonInheritanceConverter), "discriminator")]
It appears more likely it should be something like
[JsonInheritanceConverter(typeof(MyInheritingType), "discriminator")]
However this does not have the desired effect the schema only includes the base type
"$ref": "#/components/schemas/MyBaseType"
Where I would be expecting
"oneOf": [ { "$ref": "#/components/schemas/MyInheritingType" } ]
Or something similar.
Does https://github.com/RicoSuter/NJsonSchema/wiki/Inheritance still represent upto data documentation?
Is there something else I need to get this to work?
BTW I am using NJsonSchema transitively Via FastEndpoints and using .net8.
https://github.com/RicoSuter/NJsonSchema/wiki/Inheritance
Using System.Text.Json
[JsonConverter(typeof(JsonInheritanceConverter), "discriminator")]
as advised above does not compile for the reason JsonConverter constructor takes a single parameter.It appears more likely it should be something like
[JsonInheritanceConverter(typeof(MyInheritingType), "discriminator")]
However this does not have the desired effect the schema only includes the base type
"$ref": "#/components/schemas/MyBaseType"
Where I would be expecting
"oneOf": [ { "$ref": "#/components/schemas/MyInheritingType" } ]
Or something similar.
Does https://github.com/RicoSuter/NJsonSchema/wiki/Inheritance still represent upto data documentation?
Is there something else I need to get this to work?
BTW I am using NJsonSchema transitively Via FastEndpoints and using .net8.