Interface PureSchema<ValueT>

A schema without any of the automatically added functions

interface PureSchema<ValueT> {
    description?: string;
    estimatedValidationTimeComplexity: number;
    example?: string;
    isContainerType: boolean;
    isOrContainsObjectPotentiallyNeedingUnknownKeyRemoval: boolean;
    preferredValidationMode: SchemaPreferredValidationMode;
    schemaType:
        | "string"
        | "number"
        | "boolean"
        | "undefined"
        | "object"
        | "restrictedNumber"
        | "allowEmptyString"
        | "any"
        | "array"
        | "custom"
        | "date"
        | "null"
        | "record"
        | "regex"
        | "tuple"
        | "allOf"
        | "allowNull"
        | "deprecated"
        | "not"
        | "oneOf"
        | "optional"
        | "root"
        | "upgraded";
    usesCustomSerDes: boolean;
    valueType: ValueT;
}

Type Parameters

  • ValueT

Hierarchy (View Summary)

Properties

description?: string

A description, which can be used by code generation tools to generate documentation

estimatedValidationTimeComplexity: number

An estimate of the time complexity for validating this element, which should be on the same order of the number of items to be validated

example?: string

An example, which can be used by code generation tools to generate documentation

isContainerType: boolean

If true, "shallow" ancestor validation mode preferences won't be used when this schemas validation mode preference is "inherit", like other built-in container types

isOrContainsObjectPotentiallyNeedingUnknownKeyRemoval: boolean

If true, this schema or any sub-elements have the potential to represent an object value that might need unknown-key removal

preferredValidationMode: SchemaPreferredValidationMode

The preferred validation mode for this schema.

The lesser level of the preferred validation mode, which will be applied recursively depending on the depth parameter / unless further re-specified, and the specified validation mode, will be used, where the order is none < soft < hard.

Special Values:

  • "initial" - use the initially specified validation mode for the current operation (ex. the validation field of the options parameter to deserialize).
  • "inherit" - use the closet applicable mode from an ancestor schema level.
schemaType:
    | "string"
    | "number"
    | "boolean"
    | "undefined"
    | "object"
    | "restrictedNumber"
    | "allowEmptyString"
    | "any"
    | "array"
    | "custom"
    | "date"
    | "null"
    | "record"
    | "regex"
    | "tuple"
    | "allOf"
    | "allowNull"
    | "deprecated"
    | "not"
    | "oneOf"
    | "optional"
    | "root"
    | "upgraded"

The type of schema

usesCustomSerDes: boolean

If true, this schema or any sub-elements have a custom serializer-deserializer

valueType: ValueT

The actual value of this field is always undefined, but this should be used for determining the value type represented by this schema, ex. typeof someSchema.valueType