0.0.47 • Published 5 years ago

@ts-common/schema2ts v0.0.47

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
5 years ago

schema2ts

JSON Schema to TypeScript. See also https://www.jsonschemavalidator.net/

See also http://json-schema.org/draft-07/schema

Normalized Schema Object

Excluding $id, $schema, $ref, $comment, title, description, default, readOnly, examples, contains, definitions, const, enum, if, then, else, allOf, anyOf, oneOf, not.

interface SimpleType {
  readonly array?: ArrayType
  readonly boolean?: BooleanType
  readonly integer?: IntegerType
  readonly null?: NullType
  readonly number?: NumberType
  readonly object?: ObjectType
  readonly string?: StringType
}

interface ArrayType {
    readonly additionalItems?: SchemaObject
    readonly items?: SchemaObject|ReadonlyArray<SchemaObject>
    readonly maxItems?: number
    readonly minItems: number
    readonly uniqueItems: boolean // default is false
}

interface BooleanType {
}

interface IntegerType extends NumberType {
}

interface NullType {
}

interface NumberType {
    readonly multipleOf?: number
    readonly maximum?: number
    readonly exclusiveMaximum?: number
    readonly minimum?: number
    readonly exclusiveMinimum?: number
}

interface ObjectType {
    readonly maxProperties?: number
    readonly minProperties: number // default is 0
    readonly required: ReadonlyArray<string> // default is []
    readonly additionalProperties?: SchemaObject
    readonly properties: StringMap<SchemaObject> // default is {}
    readonly patternProperties?: {} // ...
    readonly dependencies?: {} // ...
    readonly propertyNames?: {} // ...
}

interface StringType {
    readonly maxLength?: number
    readonly minLength: number // default is 0
    readonly patter?: string
    readonly format?: string
    readonly contentMediaType?: string
    readonly contentEncodinf?: string
}
0.0.47

5 years ago

0.0.46

6 years ago

0.0.45

6 years ago

0.0.44

6 years ago

0.0.43

6 years ago

0.0.42

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago