You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have the situation that our model classes are in Language A and the swagger must be in language B.
Furthermore we use the JsonInheritanceConverter.
The problem is that the JsonInheritanceConverter is unable to instantiate the correct type as the discriminator is in a different language.
Is it possible to include a method that provides the name, and can be overridden in a derived class?
I am currently using a custom converter based on the JsonInheritanceConverter to achieve this.
Note that inheriting from JsonInheritanceConverter is possibly only with the same name as there are some name checks in the NJsonSchema source like in
Ok, I'll change this "if" and make GetDiscriminatorValue() and GetDiscriminatorType() virtual so that you can provide your own implementation with renames (in both directions)?
Yes, if you can change the discriminator values, then we also need to evaluate this in the schema generator and code generators (will be supported in JSON Schema and OpenApi3 but not with Swagger2)
Hi,
we have the situation that our model classes are in Language A and the swagger must be in language B.
Furthermore we use the JsonInheritanceConverter.
The problem is that the JsonInheritanceConverter is unable to instantiate the correct type as the discriminator is in a different language.
Is it possible to include a method that provides the name, and can be overridden in a derived class?
I am currently using a custom converter based on the JsonInheritanceConverter to achieve this.
Note that inheriting from JsonInheritanceConverter is possibly only with the same name as there are some name checks in the NJsonSchema source like in
JsonSchemaGenerator.TryGetInheritanceDiscriminator
if (converterType.Name == "JsonInheritanceConverter")
{
....
}
The text was updated successfully, but these errors were encountered: