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
Deserialization using json fails if the "inner_required" is set to null but not the optional one, despite both evaluating to null. I am not sure this is a problem with sgen itself. Looking at the c# class definitions the only obvious difference is the Newtonsoft attribute Required. After some experimentation, I believe that the generator should use Newtonsoft.Json.Required.AllowNull instead of Newtonsoft.Json.Required.Always for these situations (ie.. when prop is nullable). See documentation here (https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Required.htm)
Find some useful examples attached include schema, csharp code, bonsai workflow and test json instances that reproduce the problem. test_deser.zip
The text was updated successfully, but these errors were encountered:
Consider the following schema where both inner_optional and inner_required are nullable:
Deserialization using json fails if the "inner_required" is set to null but not the optional one, despite both evaluating to null. I am not sure this is a problem with sgen itself. Looking at the c# class definitions the only obvious difference is the
Newtonsoft
attributeRequired
. After some experimentation, I believe that the generator should useNewtonsoft.Json.Required.AllowNull
instead ofNewtonsoft.Json.Required.Always
for these situations (ie.. when prop is nullable). See documentation here (https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Required.htm)Find some useful examples attached include schema, csharp code, bonsai workflow and test json instances that reproduce the problem.
test_deser.zip
The text was updated successfully, but these errors were encountered: