Caplin Trader 5.1.0

Class: module:ct-core/validator/JsonValidator

module:ct-core/validator/JsonValidator(failureMessage)

new module:ct-core/validator/JsonValidator(failureMessage)

The JsonValidator is a module:ct-trading/validation/Validator that ensures the given string is valid JSON.

Parameters:
Name Type Description
failureMessage String

The i18n tag for error message to display if value is not valid JSON.

Implements:

Methods

validate(value, attributes, validationResult)

Determine whether the provided value is valid JSON or not and set the result on the provided module:br-validation/ValidationResult.

Parameters:
Name Type Description
value Object

The value to validate.

attributes Object

attributes to control the validation process. Not used in this implementation.

validationResult module:br-validation/ValidationResult

the ValidationResult in which to store the result of this validation.

Implements: