ModelValidation

model. ModelValidation

Handles validation of Model objects based on their modelDefinition.

Constructor

new ModelValidation()

Source:

Methods

(static) getModelValidation() → {ModelValidation}

Source:

Returns the ModelValidation singleton. Creates a new one if it does not yet exist. Grabs a logger instance by calling Logger.getLogger

Returns:

New or memoized instance of ModelInstance

Type
ModelValidation

validate() → {Object}

Source:
Deprecated:
  • Client side model validation is deprecated in favour of server side validation only.
Returns:

Returns {status: true, messages: []}

Type
Object

validateAgainstSchema(model) → {Array}

Source:

Sends a POST request against the api/schemas endpoint to check if the model is valid.

Parameters:
Name Type Description
model Model

The model that should be validated.

Returns:

Returns an array with validation messages if there are any.

Type
Array