function JsonSchemaTestTrait::getNormalizationForValue
Get the normalization for a value.
Override this method if the normalization needs further processing, e.g. in the case of JSON:API module's CacheableDependencyInterface.
Parameters
mixed $value: Value to be normalized.
Return value
mixed Final normalized value.
2 calls to JsonSchemaTestTrait::getNormalizationForValue()
- JsonApiJsonSchemaTestTrait::getNormalizationForValue in core/
modules/ jsonapi/ tests/ src/ Traits/ JsonApiJsonSchemaTestTrait.php - JsonSchemaTestTrait::testNormalizedValuesAgainstJsonSchema in core/
modules/ serialization/ tests/ src/ Traits/ JsonSchemaTestTrait.php - Test normalized values against the JSON schema.
File
-
core/
modules/ serialization/ tests/ src/ Traits/ JsonSchemaTestTrait.php, line 157
Class
- JsonSchemaTestTrait
- Trait for testing JSON Schema validity and fit to sample data.
Namespace
Drupal\Tests\serialization\TraitsCode
protected function getNormalizationForValue(mixed $value) : mixed {
return $this->getNormalizer()
->normalize($value, $this->getJsonSchemaTestNormalizationFormat());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.