function UnwrappingDenormalizerContextBuilder::withUnwrapPath
Configures the path of wrapped data during denormalization.
Eg: [foo].bar[bar]
Throws
See also
https://symfony.com/doc/current/components/property_access.html
File
-
vendor/
symfony/ serializer/ Context/ Normalizer/ UnwrappingDenormalizerContextBuilder.php, line 39
Class
- UnwrappingDenormalizerContextBuilder
- A helper providing autocompletion for available UnwrappingDenormalizer options.
Namespace
Symfony\Component\Serializer\Context\NormalizerCode
public function withUnwrapPath(?string $unwrapPath) : static {
if (null === $unwrapPath) {
return $this->with(UnwrappingDenormalizer::UNWRAP_PATH, null);
}
try {
new PropertyPath($unwrapPath);
} catch (InvalidPropertyPathException $e) {
throw new InvalidArgumentException(\sprintf('The "%s" property path is not valid.', $unwrapPath), previous: $e);
}
return $this->with(UnwrappingDenormalizer::UNWRAP_PATH, $unwrapPath);
}