Skip to content

Schema ​

Class

constructor ​

getRef ​

parser ​

schema ​

cast ​

typescript
public cast(data: Parameter, type: Parameter): Promise<any>
public cast(data: Parameter, type: Parameter): Promise<any>

castQuery ​

typescript
public castQuery(query: Parameter): Promise<any>
public castQuery(query: Parameter): Promise<any>

Queries are supposed to have simple keys and simple/primitive values. A query like the following is not supported.

javascript
const q = {
 address: { line1: 'Mock line 1' }
}
const q = {
 address: { line1: 'Mock line 1' }
}

This should be re-written as the following instead

javascript
const q = { 'address.line1': 'Mock line 1' }
const q = { 'address.line1': 'Mock line 1' }

With this knowledge, only nested query operators (eg. $in) are also considered.

validate ​

typescript
public validate(data: Parameter, useDefault: Parameter, ignoreMissing: Parameter): Promise<any>
public validate(data: Parameter, useDefault: Parameter, ignoreMissing: Parameter): Promise<any>

validateSchema ​

typescript
public validateSchema(schema: Parameter, parentField: Parameter): Promise<any>
public validateSchema(schema: Parameter, parentField: Parameter): Promise<any>