schema-generator
Generate schemas from TS source
Example
export interface Test {
/**
* This is a test
* @pattern foo
* @default "foo"
* @description Foo stuff
* @errorMessage This is an error message
*/
foo: string
}
{
"$ref": "#/definitions/Test",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Test": {
"additionalProperties": false,
"properties": {
"foo": {
"default": "foo",
"description": "Foo stuff",
"errorMessage": "This is an error message",
"pattern": "foo",
"type": "string"
}
},
"required": [
"foo"
],
"type": "object"
}
}
}