Complete the code to define a simple JSON schema with a required string property called 'name'.
{
"type": "object",
"properties": {
"name": { "type": "[1]" }
},
"required": ["name"]
}The property 'name' should be of type string in the JSON schema.
Complete the code to add an optional integer property called 'age' to the schema.
{
"type": "object",
"properties": {
"age": { "type": "[1]" }
}
}The 'age' property should be an integer type in the JSON schema.
Fix the error in the schema by completing the type for the 'emails' property which should be an array of strings.
{
"type": "object",
"properties": {
"emails": {
"type": "[1]",
"items": { "type": "string" }
}
}
}The 'emails' property should be an array type containing strings.
Fill in the blank to define a property 'status' that can only be one of the specified string values.
{
"type": "object",
"properties": {
"status": {
"type": "[1]",
"enum": ["active", "inactive", "pending"]
}
}
}The 'status' property should be a string type with specific allowed values.
Fill all three blanks to define a schema with a required 'id' (integer), optional 'tags' (array of strings), and a 'published' boolean.
{
"type": "object",
"properties": {
"id": { "type": "[1]" },
"tags": {
"type": "[2]",
"items": { "type": "string" }
},
"published": { "type": "[3]" }
},
"required": ["id"]
}The 'id' is an integer, 'tags' is an array of strings, and 'published' is a boolean.