Releases: FriendsOfSymfony/FOSRestBundle
2.8.0-beta1
Features
-
added a
SerializerErrorHandlerthat leverages theFOS\RestBundle\Serializer\Serializerinterface
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
serializeFlattenExceptioninstances, for backwards compatibility the resulting format by default
is the same as was used for exceptions/errors before, use theflatten_exception_formatto opt-in
to a format compatible with the API Problem spec (RFC 7807):fos_rest: exception: flatten_exception_format: 'rfc7807'
-
added a new
ResponseStatusCodeListenerthat maps exception/error codes to response status codes,
enable it by setting the newmap_exception_codesoption totrue
Deprecations
-
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
stringornullfromresolve()when implementing theVersionResolverInterface. -
deprecated support for passing version numbers as integers to
Context::setVersion()(strings
will be enforced as of 3.0) -
deprecated the
isFormatTemplating(),renderTemplate(), andprepareTemplateParameters()
methods of theViewHandlerclass and theViewHandlerInterface -
deprecated the constructor of the
ViewHandlerclass, use the staticcreate()factory method
instead -
deprecated the
setTemplateVar(),setPopulateDefaultVars(),getTemplateVar(), and
isPopulateDefaultVars()methods of theController\Annotations\Viewclass -
deprecated the
setEngine(),setTemplate(),setTemplateData(),setTemplateVar(),getEngine(),
getTemplate(),getTemplateData(), andgetTemplateVar()methods of theView\Viewclass -
deprecated not setting the
fos_rest.service.templatingandfos_rest.view.default_engineoptions -
deprecated not setting the
fos_rest.view.force_redirectsoption to the empty array -
deprecated the following options:
fos_rest.exception.exception_controllerfos_rest.exception.exception_listenerfos_rest.exception.servicefos_rest.view.templating_formats
-
the 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\ExceptionNormalizer
-
the 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.templating
-
the 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\ExceptionValueMap
-
the 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\ViewHandler
2.7.4
2.7.3
2.7.2
- fixed serializing Error instances when the Symfony Serializer is used (#2110)
- fixed serializing Error instances when JMS Serializer is used (#2105)
- fixed compatibility with
nullowner returned by SensioFrameworkExtraBundle (#2097) - completely fixed handling
Throwableobjects inExceptionController::showAction(), continues #2093 (#2096)
2.7.1
2.7.0
- ignore SessionInterface and UserInterface controller action arguments
- fixed ExceptionListener deprecation warning
- fixed ControllerNameParser deprecation warning
- fixed DisableCSRFExtension::getExtendedTypes() return type
- improved EngineInterface error message in ViewHandler
- improved Symfony 4.4 compatibility
- automatically use Twig as templating engine when available
2.6.0
- ensure compatibility with the
FlattenExceptionfrom the new ErrorRenderer component - fix handling the
serialize_nulloption with the Symfony serializer - added support for using multiple constraints for the
requirementsoption of the@RequestParam
annotation - drop support for PHP 5.5, 5.6 and 7.0
- drop support for SF 4.0, 4.1 and 4.2 (3.4 LTS is still supported)
- deprecated using the
ParamFetcherclass without passing a validator as the third argument, this
argument will become mandatory in 3.0 - fix compatiblity without the deprecated templating in Symfony 4.3; see #2012 on how to configure the FOSRestBundle
- removed symfony/templating from the dependencies; if you still use it you need to require it in your app
2.5.0
- compatibility with Symfony 4.2
- deprecated the
FOSRestControllerbase class, use the newAbstractFOSRestControllerinstead - dropped support for Symfony 2.7 to 3.3
- compatibility with JMS Serializer 2 and JMSSerializerBundle 3
- overwrite rules when they are defined in different config files instead of throwing exceptions
- fixed using the
nullableoption of the param annotations when themapoption is enabled - ensure a predictable order of routes by sorting controllers by name when loading classes from a directory
- reset the internal state of the view handler to fix compatibility with PHP-PM
- fix different bugs related to the handling of API versions (see #1491, #1529, #1691)
2.4.0: fix route generator not ignoring body param converters (#1934)
[BC break] @Route::$service is no longer supported, see the changelog and #1822.
This release primarily fixes deprecations.
2.3.1
-
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