function MarkupNormalizer::getNormalizationSchema

Overrides SchematicNormalizerTrait::getNormalizationSchema

File

core/modules/serialization/src/Normalizer/MarkupNormalizer.php, line 25

Class

MarkupNormalizer
Normalizes MarkupInterface objects into a string.

Namespace

Drupal\serialization\Normalizer

Code

public function getNormalizationSchema(mixed $object, array $context = []) : array {
    return $this->getJsonSchemaForMethod($object, '__toString', [
        'type' => 'string',
        'description' => 'May contain HTML markup.',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.