NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #809 most downloaded on Packagist
This Bundle provides various tools to rapidly develop RESTful API's with Symfony
Latest stable
3.9.0
Last release 9 months ago
10 Feb 2026
Release timing varies
gaps range from 8 days to 1.1 years
Most releases are documented
notes for 46 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
99 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Don't use deprecated #[Route] methods by @HypeMC in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2422
#[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
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Allow usage with symfony/config v8 by @W0rma in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2429
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.9.0-beta1...3.9.0-beta2
Don't use deprecated #[Route] methods by @HypeMC in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2422
#[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
Update route requirements docblock by @vracini in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2411
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.7.1...3.8.0
fix: Sensio extra bundle TemplateListener invocation before view response listener and serialization by @flohw in https://github.com/FriendsOfSymfony/
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.7.0...3.7.1
Conditionally stop extending from the SensioFrameworkExtraBundle's Template annotation class by @mbabker in https://github.com/FriendsOfSymfony/FOSRes
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.6.0...3.7.0
bad url link readme.md by @asuri0n in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2382
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.5.0...3.6.0
Fixed SF 6.1 and SF 6.2 deprecations by @thomaspicquet in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2377
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.4.0...3.5.0
Allow jms serializer bundle 5.0 by @goetas in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2373
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.3.0...3.4.0
Allow new version of willdurand/jsonp-callback-validator by @mbabker in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2360
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
Fix default $strict default value in constructor by @alterphp in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2357
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.2.0...3.2.1
Setup docs by @goetas in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2348
Full Changelog: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/3.1.1...3.2.0
Fix FlattenExceptionNormalizer without custom SerializeErrorRenderer #2343
Fix some cs issue for which the build was not green #2339 by @goetas
Nothing published for this version
Nothing published for this version
fixed being able to configure exception codes and messages based on interfaces (e.g. Throwable)
Throwable)fixed the ViewHandler to not override an already set status_code in the serialization context
ViewHandler to not override an already set status_code in the serialization contextfixed handling requests without a content type inside the RequestBodyParamConverter
RequestBodyParamConverterFlattenExceptionNormalizer does no longer implement the CacheableSupportsMethodInterface to
ensure compatibility with older versions of the Symfony Serializer componentadded support for Symfony 5 compatibility
the 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\ViewHandlerfixed setting serializer options in the ViewHandler
ViewHandlerfos_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 (appli
FlattenExceptionHandler 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.routeradded support for Symfony 5 compatibility
the 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.service.templating and fos_rest.view.default_engine
options to null
changed the default value of the fos_rest.view.force_redirects option to the empty array
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.exception.exception_controllerfos_rest.exception.exception_listenerfos_rest.exception.servicefos_rest.view.templating_formatsremoved the following classes:
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\ExceptionListenerFOS\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.exception_listenerfos_rest.exception.controllerfos_rest.exception.twig_controllerfos_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\Inflector\DoctrineInflectorFOS\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\ViewHandlerNothing published for this version
Nothing published for this version
Nothing published for this version
fixed being able to configure exception codes and messages based on interfaces (e.g. Throwable)
Throwable)fixed the ViewHandler to not override an already set status_code in the serialization context
ViewHandler to not override an already set status_code in the serialization contextfixed handling requests without a content type inside the RequestBodyParamConverter
RequestBodyParamConverterFlattenExceptionNormalizer does no longer implement the CacheableSupportsMethodInterface to
ensure compatibility with older versions of the Symfony Serializer componentthe route generation feature is deprecated, disable it explicitly:
added 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\ViewHandlerdeprecated the fos_rest.access_denied_listener option
ViewHandlerfos_rest.access_denied_listener optionFOS\RestBundle\EventListener\AccessDeniedListener classfos_rest.access_denied_listener servicedeprecated not enabling the fos_rest.body_listener option explicitly, it will be disabled by default in 3.0
FlattenExceptionHandler and FlattenExceptionNormalizer send RFC 7807-compatible Content-Type header for JSON (application/problem+json) and XML (application/problem+xml)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.service.inflectorfos_rest.service.routerfos_rest.service.templatingfos_rest.view.default_enginefos_rest.view.force_redirectsthe following classes and interfaces are marked as deprecated, they will be removed in 3.0:
FOS\RestBundle\Inflector\DoctrineInflectorFOS\RestBundle\Inflector\InflectorInterfacethe following services and aliases are marked as deprecated, they will be removed in 3.0:
fos_rest.inflectorfos_rest.routerthe route generation feature is deprecated, disable it explicitly:
added 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 or consider using the RestRoutingBundle.
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 setting the fos_rest.service.templating and fos_rest.view.default_engine options
deprecated not setting the fos_rest.view.force_redirects option to the empty array
deprecated the following options:
fos_rest.exception.exception_controllerfos_rest.exception.exception_listenerfos_rest.exception.servicefos_rest.view.templating_formatsthe following classes 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\ExceptionListenerFOS\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.exception_listenerfos_rest.exception.controllerfos_rest.exception.twig_controllerfos_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\Inflector\DoctrineInflectorFOS\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\ViewHandlerfixed compatibility with JMS Serializer with explicitly disabled max depth checks
Throwable instances of classes
that do not extend PHP's Exception class (#2131)harden the JsonToFormDecoder to not error on non-array input
JsonToFormDecoder to not error on non-array input (#2145)fixed serializing Error instances when the Symfony Serializer is used
null owner returned by SensioFrameworkExtraBundle (#2097)Throwable objects in ExceptionController::showAction(), continues #2093 (#2096)fixed handling all Throwable objects in ExceptionController::showAction()
Throwable objects in ExceptionController::showAction() (#2093)ViewHandlerInterface alias definition (#2085)fixed ExceptionListener deprecation warning
deprecated using the ParamFetcher class without passing a validator as the third argument, this argument will become mandatory in 3.0
FlattenException from the new ErrorRenderer componentserialize_null option with the Symfony serializerrequirements option of the @RequestParam
annotationParamFetcher class without passing a validator as the third argument, this
argument will become mandatory in 3.0deprecated the FOSRestController base class, use the new AbstractFOSRestController instead
FOSRestController base class, use the new AbstractFOSRestController insteadnullable option of the param annotations when the map option is enabledThis release primarily fixes deprecations.
[BC break] @Route::$service is no longer supported, see the changelog and https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1822.
This release primarily fixes deprecations.
@Route annotation and all its children no longer extend SensioFrameworkExtraBundle's annotation.
The main effect is that @Route::$service is no longer available. Instead, define your controllers using the FQCN
as service IDs or create an alias in the container using the FQCN.improved Symfony 4 compatibility
improved Symfony 4 compatibility
manually decorate the core JMS handler registry
run checks after SensioFrameworkExtraBundle
made the view handler alias public
check for definitions before they might be removed
added Yaml routing resource support
refactored several unit tests
added support for file paths to the directory route loader
added support for file paths to the directory route loader
added support for context factories when using JMS Serializer
the RequestBodyParamConverter ignores unrelated controller arguments to not conflict with Symfony's built-in
argument resolver
made the bundle compatible with SensioFrameworkExtraBundle 4.x
added some interface aliases to support by ID autowiring
added support for custom keys for groups when using JMSSerializerBundle
allow to load FOSRestBundle inside the kernel before JMSSerializerBundle
added the fos_rest.routing_loader.prefix_methods option to disable method name prefixes in generated route names
removed newline characters from exception messages
Nothing published for this version
Nothing published for this version
setMaxDepth is deprecated in favor of enabledMaxDepth and disableMaxDepth
[BC BREAK] Context::getGroups() may return null whereas before it only returned array.
FileParam::$map is addedsetMaxDepth is deprecated in favor of enabledMaxDepth and disableMaxDepthpattern in your routing files is deprecatedNothing published for this version
See https://github.com/FriendsOfSymfony/FOSRestBundle/compare/2.0.0...2.0.1
See https://github.com/FriendsOfSymfony/FOSRestBundle/compare/2.0.0...2.0.1
Don't forget to read the UPGRADE file !
Don't forget to read the UPGRADE file !
This new major version is ready after months of beta ! It contains many features (some of them are BC and are included in 1.8) such as:
ExceptionWrapper in favor of the serializers normalizersDon't hesitate to ping us here or on twitter if you have any feedback :)
Nothing published for this version
Nothing published for this version
FOSRestBundle 1.8 doesn't come alone.
FOSRestBundle 1.8 doesn't come alone.
You want something big ? FOSRestBundle 2.0 is here !
Some reasons to migrate to this version as soon as possible:
ParamFetcherControllerTrait to fit all your needsExceptionController to not depend on twig anymoreExceptionWrapper by normalizers (that way you can customize the exception controller output easily).Again thank you to all our contributors and specifically to @lsmith77 and @xabbuh !
Enjoy !
And mostly, many deprecations to ease the upgrade path to 2.0! We hope you'll enjoy this version and don't hesitate to open an issue if you find a bug…
We've been long (almost a year since 1.7 was released) but 1.8 and 2.0 are finally ready !
1.8 contains:
And mostly, many deprecations to ease the upgrade path to 2.0! We hope you'll enjoy this version and don't hesitate to open an issue if you find a bug !
Thanks to all our contributors and even more to @xabbuh and @lsmith77, without them this bundle we wouldn't be that far !
added a new InvalidParameterException as a specialization of the BadRequestHttpException
deprecated the FOS\RestBundle\Util\ViolationFormatter class and the
FOS\RestBundle\Util\ViolationFormatterInterface
deprecated the ViolationFormatterInterface argument of the ParamFetcher class constructor
deprecated the RedirectView and RouteRedirectView classes, use View::createRedirect() and
View::createRouteRedirect() instead
added a fos_rest.exception.debug config option that defaults to the kernel.debug container
parameter and can be turned on to include the caught exception message in the exception controller's
response
introduced the concept of REST zones which makes it possible to disable all REST listeners when a request matches certain attributes
fixed that serialization groups are always passed to the constructor as an array
added annotations to support additional HTTP methods defined by RFC 2518 (WebDAV)
added a new loader that allows to extract REST routes from all controller classes from a directory
introduced a serializer adapter layer to ease the integration of custom serialization implementations
deprecated the getter methods of the ViewHandler class
fixed an issue that prevented decoration of the TemplateReferenceInterface from the Symfony
Templating component
fixed: no longer overwrite an explicitly configured template in the view response listener
added support for API versioning in URL parameters, the Accept header or using a custom header
marked some classes and methods as internal, do no longer use them in your code as they are likely to be removed in future releases
deprecated the DoctrineInflector class and the InflectorInterface from the
FOS\RestBundle\Util\Inflectorin favor of their replacements in the FOS\RestBundle\Inflector
namespace
deprecated the FormatNegotiator class and the FormatNegotiatorInterface from the
FOS\RestBundle\Util namespace in favor of the new FOS\RestBundle\Negotiation\FormatNegotiator
class
deprecated the FOS\RestBundle\Util\MediaTypeNegotiatorInterface which should no longer be used
Nothing published for this version
After more than 3 months of work, we finally release the first RC phase of FOSRestBundle 1.8!
After more than 3 months of work, we finally release the first RC phase of FOSRestBundle 1.8!
It contains major improvements such as:
Thanks a lot to @lsmith77 and @xabbuh for their reviews, their contributions and the time they passed to improve FOSRestBundle :-) Also a big thank to @stof for helping us and always being here when we need it !
If you suffer any problem with this version, just open an issue we'll take care of you as soon as possible.
handle \Throwable instances in the ExceptionController
\Throwable instances in the ExceptionControllerCamelKeysNormalizer from removing leading underscoresAllowedMethodsRouteLoader to work with Symfony 3.0See https://github.com/FriendsOfSymfony/FOSRestBundle/compare/1.7.7...1.7
See https://github.com/FriendsOfSymfony/FOSRestBundle/compare/1.7.7...1.7
removed uses of the reflection API in favor of faster solutions when possible
fixed the configuration to use serialization groups and versions at the same time
when using Symfony 3.x, the bundle doesn't call methods anymore that have been deprecated in Symfony 2.x and were removed in Symfony 3.0
when using Symfony 3.x, the bundle doesn't call methods anymore that have been deprecated in Symfony 2.x and were removed in Symfony 3.0
the ViewResponseListener does not overwrite explicitly configured templates anymore
fixed the ParamFetcher class to properly handle sub requests
see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1267/files#diff-4fa66b9bfb12d4f2063913903fc11b69R59
see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1267/files#diff-4fa66b9bfb12d4f2063913903fc11b69R59
CamelKeysNormalizerWithLeadingUnderscore that keeps leading underscores when
converting snake case to camel case (for example, leaving _username unchanged)removed some code from the ViewResponseListener class that was already present in the parent TemplateListener class
ViewResponseListener class that was already present in the parent
TemplateListener classOne column per quarter.