blob: cfb587be4122f85c00e6cd226a5198dc4ed3f731 [file] [log] [blame]
cue def jsonschema: schema.json -p schema -l '"Person"::'
cmp stdout expect-stdout
-- expect-stdout --
package schema
Person :: {
// Person
Schema :: {
// The person's first name.
firstName?: string
// The person's last name.
lastName?: string
// Age in years which must be equal to or greater than zero.
age?: >=0
...
}
}
-- schema.json --
{
"$id": "https://example.com/person.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "The person's first name."
},
"lastName": {
"type": "string",
"description": "The person's last name."
},
"age": {
"description": "Age in years which must be equal to or greater than zero.",
"type": "integer",
"minimum": 0
}
}
}
-- cue.mod --