Your schema doesn't specify which properties are required
. You need to set required
to the fields you want to be there. You may also wish to set additionalProperties
to false
.
Docs: https://json-schema.org/understanding-json-schema/reference/object.html#required-properties
I don't see nullable
as a key anywhere in the json schema docs.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.biz",
"type": "object",
"properties": {
"form": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The unique identifier of the form."
},
"name": {
"type": "string",
"description": "The name of the form."
}
},
"required": ["id", "name"],
"additionalProperties": false
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…