trait SchematicNormalizerFallbackTrait
Trait for generating helpful schema-generation fallback messages.
Hierarchy
- trait \Drupal\serialization\Normalizer\SchematicNormalizerFallbackTrait
1 file declares its use of SchematicNormalizerFallbackTrait
- JsonSchemaProviderSerializerTrait.php in core/
modules/ serialization/ src/ Serializer/ JsonSchemaProviderSerializerTrait.php
File
-
core/
modules/ serialization/ src/ Normalizer/ SchematicNormalizerFallbackTrait.php, line 10
Namespace
Drupal\serialization\NormalizerView source
trait SchematicNormalizerFallbackTrait {
public static function generateNoSchemaAvailableMessage(mixed $object) : string {
$baseMessage = 'See https://www.drupal.org/node/3424710 for information on implementing schemas in your program code.';
return is_object($object) ? sprintf('No schema is defined for property of type %s. %s', $object::class, $baseMessage) : sprintf('No schema defined for this property. %s', $baseMessage);
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.