Here is sample JSON schema code: What is "$ref": "#" referring to? Is it here? or do they mean the whole document? You can find this entire schema on https://www.jsonschemavalidator.net Select Schema Draft V7.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"nonNegativeInteger": {
"type": "integer",
"minimum": 0
},
"nonNegativeIntegerDefault0": {
"allOf": [
{ "$ref": "#/definitions/nonNegativeInteger" },
{ "default": 0 }
]
},....