Skip to content
Newer
Older
100644 166 lines (116 sloc) 7.57 KB
b240acc @lsmith77 moved upgrading hints and expanded them
lsmith77 authored
1 Upgrading
2 =========
3
848e6c0 @lsmith77 prepare 1.1.0
lsmith77 authored
4 This document will be updated to list important BC breaks and behavioral changes.
fee18a0 @lsmith77 refactored API for configuring the serializer
lsmith77 authored
5
afab6cc @lsmith77 prepare for 2.0
lsmith77 authored
6 ### upgrading to 2.0.0
cccefd9 @merk Deprecate RouteRedirectView and RedirectView
merk authored
7
0043714 @lsmith77 use mime type mapping in the format negotiator
lsmith77 authored
8 * it is now recommended to explicitly configure the format to mime type mapping via ``fos_rest.view.mime_types``
efe34c0 @lsmith77 removed support for Symfony\Component\Validator\ValidatorInterface
lsmith77 authored
9 * dropped support for the legacy ``Symfony\Component\Validator\ValidatorInterface``
a1fa465 @lsmith77 removed FOS\RestBundle\Util\Codes in favor of Symfony\Component\HttpF…
lsmith77 authored
10 * removed ``FOS\RestBundle\Util\Codes`` in favor of ``Symfony\Component\HttpFoundation\Response``
7970b0c @lsmith77 added `ControllerTrait` for developers that prefer to use DI for thei…
lsmith77 authored
11 * compatibility with Symfony <2.7, JMS Serializer/SerializerBundle <1.0 and SensioFrameworkExtraBundle <3.0 was dropped
63fd0ac @lsmith77 typo fix
lsmith77 authored
12 * RedirectView and RouteRedirectView view were removed. Use View::createRedirect and
cccefd9 @merk Deprecate RouteRedirectView and RedirectView
merk authored
13 View::createRouteRedirect instead. Note: the default status code for a route redirect
14 has changed from HTTP_CREATED (201) to HTTP_FOUND (302).
7970b0c @lsmith77 added `ControllerTrait` for developers that prefer to use DI for thei…
lsmith77 authored
15 * constructor signature of DisableCSRFExtension was changed
16 * removed ``callback_filter`` configuration option for the jsonp_handler
afab6cc @lsmith77 prepare for 2.0
lsmith77 authored
17 * ``exception_wrapper_handler`` is now the name of a service and not the name of a class
0043714 @lsmith77 use mime type mapping in the format negotiator
lsmith77 authored
18 * removed all ``.class`` parameters, instead overwriting services via explicit Bundle configuration is preferred
7970b0c @lsmith77 added `ControllerTrait` for developers that prefer to use DI for thei…
lsmith77 authored
19 * renamed ``AbstractScalarParam::$array`` to ``AbstractScalarParam::$map``
20 * added `ControllerTrait` for developers that prefer to use DI for their controllers instead of extending ``FOSRestController``
f2ce2c7 @Ma27 more review fixes
Ma27 authored
21 * when having an action called ``lockUserAction``, then it will have to use the http method ``LOCK`` (RFC-2518) instead of ``PATCH``. The following methods are affected by this change
22 * ``COPY``
23 * ``LOCK``
24 * ``MKCOL``
25 * ``MOVE``
26 * ``PROPFIND``
27 * ``PROPPATCH``
28 * ``UNLOCK``
047620d @lsmith77 adjust upgrading guide
lsmith77 authored
29
a336335 @lsmith77 Dropping Symfony 2.2 support
lsmith77 authored
30 ### upgrading from 1.5.*
31
32 * Dropped support for Symfony 2.2 (which includes dropping support for "pattern" in favor of only supporting "path" in routes), see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/952
33 * Dropped support for SensioFrameworkExtraBundle 2.x, see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/952
75a46a5 @xabbuh SensioFrameworkExtraBundle 2.0.x compatibility
xabbuh authored
34 (support for SensioFrameworkExtraBundle was added back in version 1.6.1 of the FOSRestBundle)
a336335 @lsmith77 Dropping Symfony 2.2 support
lsmith77 authored
35
45b7fb0 @lsmith77 added upgrading info for 1.5.0
lsmith77 authored
36 ### upgrading from 1.4.*
37
38 * In JsonToFormDecoder prefer to transform false data to null, see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/883
7aa99c5 @lsmith77 added another hint for the upgrading guide
lsmith77 authored
39 * Routing name is no longer appended to generic route name, see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/879
45b7fb0 @lsmith77 added upgrading info for 1.5.0
lsmith77 authored
40
047620d @lsmith77 adjust upgrading guide
lsmith77 authored
41 ### upgrading from 1.3.*
42
5a0d541 @abstrus Made ViewHandler::getSerializationContext protected
abstrus authored
43 * [`ViewHandler::getSerializationContext`](https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/View/ViewHandler.php) is now a `protected` method instead of `public`.
57d9e60 @lsmith77 mention BodyListener priority revert
lsmith77 authored
44 * BodyListener priority has been reverted back to 10 (see https://github.com/FriendsOfSymfony/FOSRestBundle/issues/763)
cccefd9 @merk Deprecate RouteRedirectView and RedirectView
merk authored
45
69d6acf @lsmith77 re-integrate friendsofsymfony/rest
lsmith77 authored
46 ### upgrading from 1.0.0-RC1
47
48 * The Bundle no longer depends on "friendsofsymfony/rest" and as a result several class names have changed.
49 Specifically ``FOS\Rest\Util\Codes`` is now ``FOS\RestBundle\Util\Codes`` and also the sub-namespace for
50 the decoders has changed from ``FOS\Rest\Decoder`` to ``FOS\RestBundle\Decoder``. In practice it should be
51 sufficient to simply search replace ``FOS\Rest\`` with ``FOS\RestBundle\`.
0614cb3 @lsmith77 updated information about serializer dependency
lsmith77 authored
52 * The XmlDecoder now has a dependency on "symfony/serializer"
69d6acf @lsmith77 re-integrate friendsofsymfony/rest
lsmith77 authored
53
5ab242a @lsmith77 fix changelog version
lsmith77 authored
54 ### upgrading from 0.13.1
522fc1d @tonivdv Update UPGRADING.md doc
tonivdv authored
55
18e53ee @odino updated UPGRADING.md
odino authored
56 * ExceptionController::showAction() doesn't have type hint on the $exception object anymore due to a BC change
57 in symfony/symfony 2.3.5, see https://github.com/FriendsOfSymfony/FOSRestBundle/pull/565
58
aa5a6ee @tonivdv Add upgrading note regarding the general error structure
tonivdv authored
59 * POST routes now pluralize the resource name, ie. /users vs. /user
60
d113e2a @TorbenBr fix links
TorbenBr authored
61 * The response for non-valid Forms has changed. See http://symfony.com/doc/master/bundles/FOSRestBundle/2-the-view-layer.html#forms-and-views
aa5a6ee @tonivdv Add upgrading note regarding the general error structure
tonivdv authored
62
63 * The default error message structure has changed.
64
65 _Old structure_
66
67 {
68 "status": "error",
69 "status_code": 400,
70 "status_text": "Bad Request",
71 "current_content": "",
72 "message": "New comment is not valid."
73 }
74
75 _New structure_
76
77 {
78 "code": 400,
79 "message": "New comment is not valid.";
80 }
81
d113e2a @TorbenBr fix links
TorbenBr authored
82 _Alternatively you can inject your own implementation. See http://symfony.com/doc/master/bundles/FOSRestBundle/2-the-view-layer.html#forms-and-views_
522fc1d @tonivdv Update UPGRADING.md doc
tonivdv authored
83
faaa682 @lsmith77 refactored the FormatListener and FormatNegotiator to allow configura…
lsmith77 authored
84 * The ``format_listener`` configuration has changed to allow different settings per host/path.
85 Finally the signature of FormatNegotiatorInterface::getBestFormat() changed.
83214b7 @lsmith77 set the default for default_priorities to only 'html' for security re…
lsmith77 authored
86
3287e6b @mvrhov use separate function for setting route parameters
mvrhov authored
87 ### upgrading from 0.12.0
88
aa240e6 @lsmith77 typo fix
lsmith77 authored
89 * Route parameters cannot be set via setData anymore, please use a dedicated function `setRouteParameters` from now on
3287e6b @mvrhov use separate function for setting route parameters
mvrhov authored
90
fa5f64d @lsmith77 refactored the View class to leverage the new SerializationContext
lsmith77 authored
91 ### upgrading from 0.11.0
92
93 * now requires JMSSerializerBundle 0.12
94 * refactored the View class to drop the serializer specific methods in favor of setSerializationContext()
95 * default version/groups will now only be applied if no SerializationContext was explicitly set on the View
96
0be73b0 @lsmith77 JMSSerializerBundle 1.0 compatibility
lsmith77 authored
97 ### upgrading from 0.10.0
98
fa5f64d @lsmith77 refactored the View class to leverage the new SerializationContext
lsmith77 authored
99 * now requires JMSSerializerBundle 1.0 (later renamed to 0.11) which is not compatible with Symfony2.0
0be73b0 @lsmith77 JMSSerializerBundle 1.0 compatibility
lsmith77 authored
100
c2ba471 @lsmith77 added 0.9.0 section
lsmith77 authored
101 ### upgrading from 0.9.0
102
d113e2a @TorbenBr fix links
TorbenBr authored
103 * the view response listener is now disabled by default. See [enable view listener](http://symfony.com/doc/master/bundles/FOSRestBundle/3-listener-support.html#view-response-listener) for how to enable it.
826c0f9 @lsmith77 added note about JMSSerializerBundle being optional
lsmith77 authored
104 * JMSSerializerBundle is now an optional dependency and therefore needs to be added explicitly
c2ba471 @lsmith77 added 0.9.0 section
lsmith77 authored
105
106 ### upgrading from 0.7.0
5be080d @lsmith77 added upgrading guide from 0.7.0 to master
lsmith77 authored
107
108 * renamed "query" fetcher to "param" fetcher, this affects the configuration as well as the name of interfaces and request attributes
6f3fa71 @lsmith77 improved handling when passing in only a form instance as the data
lsmith77 authored
109 * ViewHandler now only calls "createView()" in a single form instance set as "form" in the data array
b753f22 @lsmith77 added missing entry about serializer_version in the UPGRADING.md file
lsmith77 authored
110 * removed "serializer_version" config option on favor of "serializer: ['version': ..]"
5be080d @lsmith77 added upgrading guide from 0.7.0 to master
lsmith77 authored
111
c2ba471 @lsmith77 added 0.9.0 section
lsmith77 authored
112 ### upgrading from 0.6.0
fee18a0 @lsmith77 refactored API for configuring the serializer
lsmith77 authored
113
ea5b8c9 @ramol missing important asterix *
ramol authored
114 * renamed [get|set]Objects*() to [get|set]Serializer*()
fee18a0 @lsmith77 refactored API for configuring the serializer
lsmith77 authored
115 * renamed the "objects_version: XXX" configuration option to "serializer: [version: XXX]"
116 * moved serializer configuration code from ViewHandler::createResponse() to ViewHandler::getSerializer()
10321e5 @lsmith77 made getSerializer() protected again (use the callback instead)
lsmith77 authored
117 * made ViewHandler::getSerializer() protected again
b240acc @lsmith77 moved upgrading hints and expanded them
lsmith77 authored
118
baff2cf @asm89 Update docs and add note in UPGRADING.md
asm89 authored
119 ### 19 April 2012
120
121 * Change route fallback action to PATCH instead of POST
122
123 Automatically generated routes will now fall back to the PATCH instead of the POST method.
124
125 More information in the docs, at [this issue](https://github.com/FriendsOfSymfony/FOSRestBundle/issues/223) and [this PR](https://github.com/FriendsOfSymfony/FOSRestBundle/pull/224).
126
b240acc @lsmith77 moved upgrading hints and expanded them
lsmith77 authored
127 ### upgrading from 0.5.0_old_serializer
128
129 * The ViewInterface is gone so you might have to change your controller config if you refer to the fos_rest.view service.
130
131 * The View class is now split into a View (simple data container) and a ViewHandler (contains the actual rendering logic).
132
133 The following code would need to be changed:
134
0a0fca8 @lsmith77 formatting tweak
lsmith77 authored
135 public function indexAction($name = null)
136 {
137 $view = $this->container->get('fos_rest.view');
138
139 if (!$name) {
140 $view->setResourceRoute('_welcome');
141 } else {
142 $view->setParameters(array('name' => $name));
143 $view->setTemplate(new TemplateReference('LiipHelloBundle', 'Hello', 'index'));
144 }
145
146 return $view->handle();
147 }
b240acc @lsmith77 moved upgrading hints and expanded them
lsmith77 authored
148
149 To the following code:
150
0a0fca8 @lsmith77 formatting tweak
lsmith77 authored
151 public function indexAction($name = null)
152 {
153 if (!$name) {
154 $view = \FOS\RestBundle\View\RouteRedirectView::create('_welcome');
155 } else {
156 $view = \FOS\RestBundle\View\View::create(array('name' => $name))
157 ->setTemplate(new TemplateReference('LiipHelloBundle', 'Hello', 'index'));
158 ;
159 }
160
161 return $this->container->get('fos_rest.view_handler')->handle($view);
b240acc @lsmith77 moved upgrading hints and expanded them
lsmith77 authored
162 }
163
0a64c32 @lsmith77 added a note on JMSSerializerBundle
lsmith77 authored
164 * The custom Serializer class was removed instead JMSSerializerBundle is now used, which
0a0fca8 @lsmith77 formatting tweak
lsmith77 authored
165 replaces the concept of normalizers/encoders with the concept of visitors and handler
Something went wrong with that request. Please try again.