References ErrorNormalizer
Reference
C
Class

ApiPlatform\JsonApi\Serializer\ErrorNormalizer

Converts Exception or FlattenException or to a JSON API error representation.

class ApiPlatform\JsonApi\Serializer\ErrorNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, ApiPlatform\Serializer\CacheableSupportsMethodInterface
{
    public __construct(bool $debug, array $defaultContext, null|Symfony\Component\Serializer\Normalizer\NormalizerInterface $itemNormalizer, null|Symfony\Component\Serializer\Normalizer\NormalizerInterface $constraintViolationListNormalizer)
    public normalize($object, null|string $format, array $context): array
    public supportsNormalization($data, null|string $format, array $context): bool
    public getSupportedTypes($format): array
    public hasCacheableSupportsMethod(): bool
}

Methods

__construct

public __construct(bool $debug, array $defaultContext, null|Symfony\Component\Serializer\Normalizer\NormalizerInterface $itemNormalizer, null|Symfony\Component\Serializer\Normalizer\NormalizerInterface $constraintViolationListNormalizer)

Parameters

debugbool
defaultContextarray
itemNormalizerSymfony\Component\Serializer\Normalizer\NormalizerInterface
constraintViolationListNormalizerSymfony\Component\Serializer\Normalizer\NormalizerInterface

normalize

Normalizes an object into a set of arrays/scalars.

public normalize($object, null|string $format, array $context): array

Parameters

object
formatstring
contextarray

Returns

array

supportsNormalization

Checks whether the given class is supported for normalization by this normalizer.

public supportsNormalization($data, null|string $format, array $context): bool

Parameters

data
formatstring
contextarray

Returns

bool

getSupportedTypes

public getSupportedTypes($format): array

Parameters

format

Returns

array

hasCacheableSupportsMethod

public hasCacheableSupportsMethod(): bool

Returns

bool

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop