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
After running the sgen application, the corresponding csharp classes do not honor the defaults of objects from the json. For instance, calling Container will initialize the corresponding properties as nullable_foo and foo_w_defaults as null instead of following the defaults. For instance, one would expect that the foo_w_defaults property follows:
This probably happens because the constructors of these classes are not explicitly initializing the variables with any value and instead rely on the default value given by the compiler (null).
Consider the following schema (for readability I will also add the corresponding class defined in Pydantic)
and the corresponding json-schema:
After running the sgen application, the corresponding csharp classes do not honor the defaults of objects from the json. For instance, calling
Container
will initialize the corresponding properties asnullable_foo
andfoo_w_defaults
as null instead of following the defaults. For instance, one would expect that thefoo_w_defaults
property follows:This probably happens because the constructors of these classes are not explicitly initializing the variables with any value and instead rely on the default value given by the compiler (null).
Using the constructor operators in Bonsai and printing it to the console returns:
The text was updated successfully, but these errors were encountered: