Class: Schema

Schema


new Schema(definition)

js-data's Schema class.

import {Schema} from 'js-data'
Parameters:
Name Type Description
definition Object

Schema definition according to json-schema.org

Source:

Extends

Members


<static> typeGroupValidators :Object

TODO

Type:
  • Object
Source:

<static> types :Object

TODO

Type:
  • Object
Source:

<static> validationKeywords :Object

TODO

Type:
  • Object
Source:

Methods


<static> validate(value, schema, opts)

TODO

Parameters:
Name Type Argument Description
value *

TODO

schema Object <optional>

TODO

opts Object <optional>

Configuration options.

Source:

dbg()

Inherited From:
Source:

log()

Inherited From:
Source:

validate(target)

This adds ES5 getters/setters to the target based on the "properties" in this Schema, which makes possible change tracking and validation on property assignment.

Parameters:
Name Type Description
target Object

The prototype to which to apply this schema.

Source:

validate(value, opts)

Validate the provided value against this schema.

Parameters:
Name Type Argument Description
value *

Value to validate.

opts Object <optional>

Configuration options.

Source:
Returns:

Array of errors or undefined if valid.

Type
array | undefined