| -- basic.json -- |
| { |
| "$schema": "http://json-schema.org/draft-07/schema#", |
| |
| "type": "object", |
| "title": "Main schema", |
| "description": "Specify who you are and all.", |
| |
| "properties": { |
| "person": { |
| "description": "A person is a human being.", |
| "type": "object", |
| "required": [ "name" ], |
| "properties": { |
| "name": { "type": "string" }, |
| "address": { |
| "description": "where does this person live?", |
| "type": "string" |
| }, |
| "children": { |
| "type": "array", |
| "items": { "type": "string" }, |
| "default": [] |
| }, |
| "home phone": { |
| "type": "string", |
| "deprecated": true |
| } |
| } |
| } |
| } |
| } |
| |
| -- out.cue -- |
| // Main schema |
| // |
| // Specify who you are and all. |
| Schema :: _ @jsonschema(schema="http://json-schema.org/draft-07/schema#") |
| Schema :: { |
| // A person is a human being. |
| person?: { |
| name: string |
| |
| // where does this person live? |
| address?: string |
| children?: [...string] |
| "home phone"?: string @deprecated() |
| ... |
| } |
| ... |
| } |