class ValidJSONConstraint in JSON Field 8
JSON Field valid JSON constraint.
Verifies that input values are valid JSON.
Plugin annotation
@Constraint(
id = "valid_json",
label = @Translation("Valid deserializable JSON text", context = "Validation")
)
Hierarchy
- class \Drupal\json_field\Plugin\Validation\Constraint\ValidJSONConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of ValidJSONConstraint
File
- src/
Plugin/ Validation/ Constraint/ ValidJSONConstraint.php, line 17
Namespace
Drupal\json_field\Plugin\Validation\ConstraintView source
class ValidJSONConstraint extends Constraint {
/**
* The default violation message.
*
* @var string
*/
public $message = 'The supplied text is not valid JSON data (@error).';
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ValidJSONConstraint:: |
public | property | The default violation message. |