Skip to content

@iamcalegari/mongoat / ModelValidationSchema

Interface: ModelValidationSchema<T> ​

Defined in: src/types/model.ts:120

Extends ​

  • JSONSchema4Subset

Type Parameters ​

T ​

T extends DefaultProperties = any

Properties ​

additionalProperties? ​

optional additionalProperties?: boolean | JSONSchema4Subset

Defined in: src/types/model.ts:25

Inherited from ​

JSONSchema4Subset.additionalProperties


bsonType ​

bsonType: string | string[]

Defined in: src/types/model.ts:138


description? ​

optional description?: string

Defined in: src/types/model.ts:26

Inherited from ​

JSONSchema4Subset.description


enum? ​

optional enum?: unknown[]

Defined in: src/types/model.ts:27

Inherited from ​

JSONSchema4Subset.enum


items? ​

optional items?: ModelValidationSchema<any>

Defined in: src/types/model.ts:139


maximum? ​

optional maximum?: number

Defined in: src/types/model.ts:36

Fragmento usado pelo açúcar @Max sobre @Prop.

Inherited from ​

JSONSchema4Subset.maximum


maxLength? ​

optional maxLength?: number

Defined in: src/types/model.ts:32

Fragmentos usados pelos açúcares @MaxLength/@MinLength sobre @Prop — mesma semântica de $jsonSchema do MongoDB para strings.

Inherited from ​

JSONSchema4Subset.maxLength


minimum? ​

optional minimum?: number

Defined in: src/types/model.ts:41

Fragmento usado pelo açúcar @Min sobre @Prop.

Inherited from ​

JSONSchema4Subset.minimum


minLength? ​

optional minLength?: number

Defined in: src/types/model.ts:37

Inherited from ​

JSONSchema4Subset.minLength


pattern? ​

optional pattern?: string

Defined in: src/types/model.ts:42

Inherited from ​

JSONSchema4Subset.pattern


properties? ​

optional properties?: { [k in string | number | symbol]: ModelValidationSchema<any> }

Defined in: src/types/model.ts:140


required? ​

optional required?: keyof T[]

Defined in: src/types/model.ts:143