blob: 032d6e95c060cc2df849277ef62a2b1f17670230 [file] [log] [blame]
cue def jsonschema: schema.json -p schema -l 'Person::'
cmp stdout expect-stdout
# auto mode
cue def 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 --