S()

The S object to be exported. Noteworthily, it is safe to deprecate certain schema types simply by deleting the corresponding accessor.

new S()

Members

static bool

Get a new BooleanSchema object.

static double

Get a new NumberSchema object.

static int

Get a new IntegerSchema object.

static map

Get a new MapSchema object.

static media

Get a new MediaSchema object.

static str

Get a new StringSchema object.

SCHEMAS

Common schemas.

ValidationError

Thrown if validation fails.

Methods

static arr(schema)

Parameters:
Name Type Description
schema BaseSchema See ArraySchema#constructor
Returns:
- A new ArraySchema object.

static lock(schemas)

Lock all schemas in a dictionary (in-place).
Parameters:
Name Type Description
schemas Object.<Schema> a map of schema values
Returns:
- the input map of schema values

static obj(object)

Parameters:
Name Type Description
object Object See ObjectSchema#constructor
Returns:
- A new ObjectSchema object.

static optional(schemas)

Sets all schemas as optional (in-place).
Parameters:
Name Type Description
schemas Object.<Schema> a map of schema values
Returns:
- the input map of schema values