extend("json")

schema = `{
  "type": "object",
  "properties": {
    "id":   { "type": "integer" },
    "name": { "type": "string"  },
    "tags": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["id", "name"],
  "additionalProperties": false
}`

# 3) Some JSON documents to test.
good  = '{ "id": 7, "name": "Lava", "tags": ["repl", "rust"] }'

bad   = '{ "id": "2", "name": "123", "extra": true }'

slog( json:encode(json:schema(schema, good)) )

slog( json:encode([pretty: true], json:schema(schema, bad)))



