#[Route] methods by @HypeMC in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2422Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.8.0...3.9.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.9.0-beta1...3.9.0-beta2
#[Route] methods by @HypeMC in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2422Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.8.0...3.9.0-beta1
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.7.1...3.8.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.7.0...3.7.1
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.6.0...3.7.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.5.0...3.6.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.4.0...3.5.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.3.0...3.4.0
willdurand/jsonp-callback-validator by @mbabker in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2360Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.2.1...3.3.0
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.2.0...3.2.1
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.1.1...3.2.0
Throwable)Throwable)ViewHandler to not override an already set status_code in the serialization contextViewHandler to not override an already set status_code in the serialization contextRequestBodyParamConverterFlattenExceptionNormalizer does no longer implement the CacheableSupportsMethodInterface to
ensure compatibility with older versions of the Symfony Serializer componentRequestBodyParamConverterFlattenExceptionNormalizer does no longer implement the CacheableSupportsMethodInterface to
ensure compatibility with older versions of the Symfony Serializer componentthe route generation feature was removed, setting it to another value than false leads to an
exception
support for serializing exceptions was removed, setting the fos_rest.exception.serialize_exceptions
option to anything else than false leads to an exception
support for returning anything other than string or null from resolve() when implementing
the VersionResolverInterface was removed
removed support for passing version numbers as integers to Context::setVersion()
removed the isFormatTemplating(), renderTemplate(), and prepareTemplateParameters() methods
from the ViewHandler class and the ViewHandlerInterface
the constructor of the ViewHandler class is private now, use the static create() factory
method instead
removed the setTemplateVar(), setPopulateDefaultVars(), getTemplateVar(), and
isPopulateDefaultVars() methods from the Controller\Annotations\View class
removed the setEngine(), setTemplate(), setTemplateData(), setTemplateVar(), getEngine(),
getTemplate(), getTemplateData(), and getTemplateVar() methods from the View\View class
changed the default value of the fos_rest.body_listener option to false
removed the setMaxDepth()/getMaxDepth() methods from the Context class, use
enableMaxDepth()/disableMaxDepth() instead
dropped support for Symfony components < 4.4
removed the following options:
fos_rest.access_denied_listenerfos_rest.exception.exception_controllerfos_rest.exception.exception_listenerfos_rest.exception.servicefos_rest.service.inflectorfos_rest.service.routerfos_rest.service.templatingfos_rest.view.default_enginefos_rest.view.force_redirectsfos_rest.view.templating_formatsremoved the following classes and interfaces:
FOS\RestBundle\Controller\Annotations\NamePrefixFOS\RestBundle\Controller\Annotations\NoRouteFOS\RestBundle\Controller\Annotations\PrefixFOS\RestBundle\Controller\Annotations\RouteResourceFOS\RestBundle\Controller\Annotations\VersionFOS\RestBundle\Controller\ExceptionControllerFOS\RestBundle\Controller\TemplatingExceptionControllerFOS\RestBundle\Controller\TwigExceptionControllerFOS\RestBundle\EventListener\AccessDeniedListenerFOS\RestBundle\EventListener\ExceptionListenerFOS\RestBundle\Inflector\DoctrineInflectorFOS\RestBundle\Inflector\InflectorInterfaceFOS\RestBundle\Routing\Loader\DirectoryRouteLoaderFOS\RestBundle\Routing\Loader\Reader\RestActionReaderFOS\RestBundle\Routing\Loader\Reader\RestControllerReaderFOS\RestBundle\Routing\Loader\RestRouteLoaderFOS\RestBundle\Routing\Loader\RestRouteProcessorFOS\RestBundle\Routing\Loader\RestXmlCollectionLoaderFOS\RestBundle\Routing\Loader\RestYamlCollectionLoaderFOS\RestBundle\Routing\ClassResourceInterfaceFOS\RestBundle\Routing\RestRouteCollectionFOS\RestBundle\Serializer\Normalizer\ExceptionHandlerFOS\RestBundle\Serializer\Normalizer\ExceptionNormalizerremoved the following services and aliases:
fos_rest.access_denied_listenerfos_rest.exception_listenerfos_rest.exception.controllerfos_rest.exception.twig_controllerfos_rest.inflectorfos_rest.routerfos_rest.routing.loader.controllerfos_rest.routing.loader.directoryfos_rest.routing.loader.processorfos_rest.routing.loader.reader.controllerfos_rest.routing.loader.reader.actionfos_rest.routing.loader.xml_collectionfos_rest.routing.loader.yaml_collectionfos_rest.serializer.exception_normalizer.jmsfos_rest.serializer.exception_normalizer.symfonyfos_rest.templatingthe following classes are marked as internal (backwards compatibility will no longer be guaranteed):
FOS\RestBundle\DependencyInjection\Compiler\HandlerRegistryDecorationPassFOS\RestBundle\DependencyInjection\FOSRestExtensionFOS\RestBundle\Form\Extension\DisableCSRFExtensionFOS\RestBundle\Form\Transformer\EntityToIdObjectTransformerFOS\RestBundle\Normalizer\CamelKeysNormalizerFOS\RestBundle\Normalizer\CamelKeysNormalizerWithLeadingUnderscoreFOS\RestBundle\Serializer\Normalizer\FormErrorHandlerFOS\RestBundle\Serializer\Normalizer\FormErrorNormalizerFOS\RestBundle\Util\ExceptionValueMapthe following classes are now final:
FOS\RestBundle\Decoder\ContainerDecoderProviderFOS\RestBundle\Decoder\JsonDecoderFOS\RestBundle\Decoder\JsonToFormDecoderFOS\RestBundle\Decoder\XmlDecoderFOS\RestBundle\Form\Transformer\EntityToIdObjectTransformerFOS\RestBundle\Negotiation\FormatNegotiatorFOS\RestBundle\Request\ParamFetcherFOS\RestBundle\Request\ParamReaderFOS\RestBundle\Request\RequestBodyParamConverterFOS\RestBundle\Response\AllowMethodsLoader\AllowedMethodsRouterLoaderFOS\RestBundle\Serializer\JMSSerializerAdapterFOS\RestBundle\Serializer\SymfonySerializerAdapterFOS\RestBundle\Version\ChainVersionResolverFOS\RestBundle\Version\Resolver\HeaderVersionResolverFOS\RestBundle\Version\Resolver\MediaTypeVersionResolverFOS\RestBundle\Version\Resolver\QueryParameterVersionResolverFOS\RestBundle\View\JsonpHandlerFOS\RestBundle\View\ViewFOS\RestBundle\View\ViewHandleradded a SerializerErrorHandler that leverages the FOS\RestBundle\Serializer\Serializer interface
to hook into the error rendering process provided by the ErrorHandler component since Symfony 4.4
added a new normalizer (for the Symfony serializer) and a new handler (for the JMS serializer) to
serialize FlattenException instances, for backwards compatibility the resulting format by default
is the same as was used for exceptions/errors before, use the flatten_exception_format to opt-in
to a format compatible with the API Problem spec (RFC 7807):
fos_rest:
exception:
flatten_exception_format: 'rfc7807'
added a new ResponseStatusCodeListener that maps exception/error codes to response status codes,
enable it by setting the new map_exception_codes option to true
the route generation feature is deprecated, disable it explicitly:
fos_rest:
routing_loader: false
You need to configure your routes explicitly, e.g. using the Symfony Core annotations or the FOSRestBundle shortcuts like FOS\RestBundle\Controller\Annotations\Get. You can use bin/console debug:router --show-controllers to help with the migration and compare routes before and after it.
Change the route loading:
Before:
Acme\Controller\TestController:
type: rest
resource: Acme\Controller\TestController
After:
Acme\Controller\TestController:
type: annotation
resource: Acme\Controller\TestController
When using the Symfony Core route loading, route names might change as the FOSRestBundle used a different naming convention. Mind the .{_format} suffix if you used the fos_rest.routing_loader.include_format option.
In case you have OpenAPI/Swagger annotations, you can also use OpenAPI-Symfony-Routing which removes the need to have routing information duplicated. It also allows to add the .{_format} suffix automatically as before.
If migration to explicit routes is not possible or feasible, consider using RestRoutingBundle which extracted the auto-generation of routes in a BC way.
deprecated support for serializing exceptions, disable it by setting the serialize_exceptions
option to false:
fos_rest:
exception:
serialize_exceptions: false
deprecated returning anything other than string or null from resolve() when implementing the VersionResolverInterface.
deprecated support for passing version numbers as integers to Context::setVersion() (strings
will be enforced as of 3.0)
deprecated the isFormatTemplating(), renderTemplate(), and prepareTemplateParameters()
methods of the ViewHandler class and the ViewHandlerInterface
deprecated the constructor of the ViewHandler class, use the static create() factory method
instead
deprecated the setTemplateVar(), setPopulateDefaultVars(), getTemplateVar(), and
isPopulateDefaultVars() methods of the Controller\Annotations\View class
deprecated the setEngine(), setTemplate(), setTemplateData(), setTemplateVar(), getEngine(),
getTemplate(), getTemplateData(), and getTemplateVar() methods of the View\View class
deprecated not enabling the fos_rest.body_listener option explicitly, it will be disabled by default
in 3.0
deprecated the following options:
fos_rest.access_denied_listenerfos_rest.exception.exception_controllerfos_rest.exception.exception_listenerfos_rest.exception.servicefos_rest.service.inflectorfos_rest.service.routerfos_rest.service.templatingfos_rest.view.default_enginefos_rest.view.force_redirectsfos_rest.view.templating_formatsthe following classes and interfaces are marked as deprecated, they will be removed in 3.0:
FOS\RestBundle\Controller\Annotations\NamePrefixFOS\RestBundle\Controller\Annotations\NoRouteFOS\RestBundle\Controller\Annotations\PrefixFOS\RestBundle\Controller\Annotations\RouteResourceFOS\RestBundle\Controller\Annotations\VersionFOS\RestBundle\Controller\ExceptionControllerFOS\RestBundle\Controller\TemplatingExceptionControllerFOS\RestBundle\Controller\TwigExceptionControllerFOS\RestBundle\EventListener\AccessDeniedListenerFOS\RestBundle\EventListener\ExceptionListenerFOS\RestBundle\Inflector\DoctrineInflectorFOS\RestBundle\Inflector\InflectorInterfaceFOS\RestBundle\Routing\Loader\DirectoryRouteLoaderFOS\RestBundle\Routing\Loader\Reader\RestActionReaderFOS\RestBundle\Routing\Loader\Reader\RestControllerReaderFOS\RestBundle\Routing\Loader\RestRouteLoaderFOS\RestBundle\Routing\Loader\RestRouteProcessorFOS\RestBundle\Routing\Loader\RestXmlCollectionLoaderFOS\RestBundle\Routing\Loader\RestYamlCollectionLoaderFOS\RestBundle\Routing\ClassResourceInterfaceFOS\RestBundle\Routing\RestRouteCollectionFOS\RestBundle\Serializer\Normalizer\ExceptionHandlerFOS\RestBundle\Serializer\Normalizer\ExceptionNormalizerthe following services and aliases are marked as deprecated, they will be removed in 3.0:
fos_rest.access_denied_listenerfos_rest.exception_listenerfos_rest.exception.controllerfos_rest.exception.twig_controllerfos_rest.inflectorfos_rest.routerfos_rest.routing.loader.controllerfos_rest.routing.loader.directoryfos_rest.routing.loader.processorfos_rest.routing.loader.reader.controllerfos_rest.routing.loader.reader.actionfos_rest.routing.loader.xml_collectionfos_rest.routing.loader.yaml_collectionfos_rest.serializer.exception_normalizer.jmsfos_rest.serializer.exception_normalizer.symfonyfos_rest.templatingthe following classes are marked as internal (backwards compatibility will no longer be guaranteed
starting with FOSRestBundle 3.0):
FOS\RestBundle\DependencyInjection\Compiler\HandlerRegistryDecorationPassFOS\RestBundle\DependencyInjection\FOSRestExtensionFOS\RestBundle\Form\Extension\DisableCSRFExtensionFOS\RestBundle\Form\Transformer\EntityToIdObjectTransformerFOS\RestBundle\Normalizer\CamelKeysNormalizerFOS\RestBundle\Normalizer\CamelKeysNormalizerWithLeadingUnderscoreFOS\RestBundle\Serializer\Normalizer\FormErrorHandlerFOS\RestBundle\Serializer\Normalizer\FormErrorNormalizerFOS\RestBundle\Util\ExceptionValueMapthe following classes are marked as final (extending them will not be supported as of 3.0):
FOS\RestBundle\Decoder\ContainerDecoderProviderFOS\RestBundle\Decoder\JsonDecoderFOS\RestBundle\Decoder\JsonToFormDecoderFOS\RestBundle\Decoder\XmlDecoderFOS\RestBundle\Form\Transformer\EntityToIdObjectTransformerFOS\RestBundle\Negotiation\FormatNegotiatorFOS\RestBundle\Request\ParamFetcherFOS\RestBundle\Request\ParamReaderFOS\RestBundle\Request\RequestBodyParamConverterFOS\RestBundle\Response\AllowMethodsLoader\AllowedMethodsRouterLoaderFOS\RestBundle\Serializer\JMSSerializerAdapterFOS\RestBundle\Serializer\SymfonySerializerAdapterFOS\RestBundle\Version\ChainVersionResolverFOS\RestBundle\Version\Resolver\HeaderVersionResolverFOS\RestBundle\Version\Resolver\MediaTypeVersionResolverFOS\RestBundle\Version\Resolver\QueryParameterVersionResolverFOS\RestBundle\View\JsonpHandlerFOS\RestBundle\View\ViewFOS\RestBundle\View\ViewHandlerViewHandlerfos_rest.access_denied_listener optionFOS\RestBundle\EventListener\AccessDeniedListener classfos_rest.access_denied_listener serviceViewHandlerfos_rest.access_denied_listener optionFOS\RestBundle\EventListener\AccessDeniedListener classfos_rest.access_denied_listener serviceFlattenExceptionHandler and FlattenExceptionNormalizer send RFC 7807-compatible Content-Type header for JSON (application/problem+json) and XML (application/problem+xml)changed the default value of the fos_rest.body_listener option to false
removed the following options:
fos_rest.service.inflectorfos_rest.service.routerfos_rest.service.templatingfos_rest.view.default_enginefos_rest.view.force_redirectsremoved the following classes and interfaces:
FOS\RestBundle\Inflector\DoctrineInflectorFOS\RestBundle\Inflector\InflectorInterfaceremoved the following services and aliases:
fos_rest.inflectorfos_rest.routerHow can I help you explore Laravel packages today?