Closed csmorley closed 5 months ago
Was missing JsonStringEnumConverter:
var options = new JsonSerializerOptions();
options.Converters.Add(new JsonStringEnumConverter());
var other = System.Text.Json.JsonSerializer.Deserialize<Schema>(response.Content, options);
I am using NJsonSchema on the schema https://csrc.nist.gov/schema/nvd/api/2.0/cve_api_json_2.0.schema and it is throwing an error on deserializing:
The following json snippet, specifically the
type":"Primary"
is the byte number for the above error:With the generated POCO that has a property:
Of type:
It seems not to know how to convert the enum, what am i missing please?
To add, it seems this is only an issue when using
JsonLibrary = CSharpJsonLibrary.SystemTextJson
as with the belowNewtonsoftJson
it deserializes ok: