THE DEV BENCH
✔️ JSON Schemahard

6. Validate a nested object

Write a schema for an object with a required "server" property that is ITSELF an object with a required "host" (string) and a required "port" (integer). Anything missing host or port inside server must be rejected.

How to approach this

Schemas nest exactly like the data does: a property whose "type" is "object" gets its own "properties" and its own "required" list. This is how you validate a config block (a database section, a resources map). The inner "required" is enforced independently of the outer one.

schema.json