1.0.1 • Published 2 years ago

@makeropsinc/schema-generator v1.0.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

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"
    }
  }
}