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
Schema entities that has properties (sub-schemas) defined with the default annotation will include a *.Defaults.cs file including the default values of those properties. This does not seem to be the case when the entity it self contains a default value.
Schema example:
{
"type": "string",
"default": "foo"
}
This schema will not generate a type that includes the defined default value.
Corvus.Json.CodeGeneration.202012: 1.0.17
The text was updated successfully, but these errors were encountered:
We should be setting the default values as statics on the schema type and then using them in the helpers for default property value retrieval on an object.
Entities that are generated from schemas that describes objects does not get it's DefaultInstance set with the default values of it's properties, wouldn't that be nice?
Example:
foo:
type: object
properties:
bar:
type: string
default: dolor sit amet
fee:
type: string
default: lorem ipsus
required:
- bar
- fee
Expectation:
var foo = Foo.DefaultInstance;
Console.WriteLine(foo.Bar); // "dolor sit amet"
Console.WriteLine(foo.Fee); // "lorem ipsus"
Schema entities that has properties (sub-schemas) defined with the
default
annotation will include a*.Defaults.cs
file including the default values of those properties. This does not seem to be the case when the entity it self contains a default value.Schema example:
This schema will not generate a type that includes the defined default value.
Corvus.Json.CodeGeneration.202012: 1.0.17
The text was updated successfully, but these errors were encountered: