struct Foo {
bool value1 = false;
double value2 = 1.0;
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/definitions/foo",
"definitions": {
"Foo": {
"type": "object",
"properties": {
"value1": {
"type": "boolean",
"default": false
},
"value2": {
"type": "number",
"default": 1.0
}
},
"required": [
"value1",
"value2"
]
}
}
}
It would be great if we could generate a JSON Schema with Default fields based on the struct initial value.
For instance:
C++ Struct
JSON Schema