Root level property
JSON schema example demonstrating a schema with properties that have default values
$id | default-values.yml |
$schema | http://json-schema.org/draft-07/schema# |
Properties
Example
{
"defaultString": "Hello",
"defaultObject": {
"foo": "bar"
}
}
defaultString
Title |
Default String |
Description |
A string property with a default |
Type | String |
Required |
No |
Default |
Hello |
defaultObject
Title |
Default Object |
Description |
An object property value with a default |
Type | Object |
Required |
No |
Default |
[object Object] |
Properties
defaultObject.foo
Title |
Foo |
Type | String |
Required |
No |
Schema
{
"$id": "default-values.yml",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Root level property",
"description": "JSON schema example demonstrating a schema with properties that have default values",
"type": "object",
"examples": [
{
"defaultString": "Hello",
"defaultObject": {
"foo": "bar"
}
}
],
"properties": {
"defaultString": {
"title": "Default String",
"description": "A string property with a default",
"type": "string",
"default": "Hello"
},
"defaultObject": {
"title": "Default Object",
"description": "An object property value with a default",
"type": "object",
"properties": {
"foo": {
"type": "string",
"title": "Foo"
}
},
"default": {
"foo": "bar"
}
}
},
"additionalProperties": false
}