trait JsonSchemaProviderSerializerTrait
Hierarchy
- trait \Drupal\serialization\Serializer\JsonSchemaProviderSerializerTrait uses \Drupal\serialization\Normalizer\SchematicNormalizerFallbackTrait
1 file declares its use of JsonSchemaProviderSerializerTrait
- Serializer.php in core/
modules/ jsonapi/ src/ Serializer/ Serializer.php
File
-
core/
modules/ serialization/ src/ Serializer/ JsonSchemaProviderSerializerTrait.php, line 10
Namespace
Drupal\serialization\SerializerView source
trait JsonSchemaProviderSerializerTrait {
use SchematicNormalizerFallbackTrait;
/**
* {@inheritdoc}
*/
public function getJsonSchema(mixed $object, array $context) : array {
try {
$normalizer_schema = $this->normalize($object, 'json_schema', $context);
} catch (NotNormalizableValueException) {
$normalizer_schema = [
'$comment' => static::generateNoSchemaAvailableMessage($object),
];
}
return $normalizer_schema;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
JsonSchemaProviderSerializerTrait::getJsonSchema | public | function | |
SchematicNormalizerFallbackTrait::generateNoSchemaAvailableMessage | public static | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.