diff --git a/docs/source/upgrade-guide.md b/docs/source/upgrade-guide.md index a9b5953710..2f12c1e8c4 100644 --- a/docs/source/upgrade-guide.md +++ b/docs/source/upgrade-guide.md @@ -12,7 +12,6 @@ myst: This upgrade guide lists all breaking changes in `plone.restapi`. It explains the steps that are needed to upgrade to the latest version. - ## Upgrading to `plone.restapi` 8.x `plone.restapi` 8.x dropped support for Python 2 and Plone 5.1 and 4.3. @@ -20,7 +19,6 @@ Upgrading to `plone.restapi` 8.x does not require any changes to your code base If you use Python 2 and a Plone version older than 5.2, stick with `plone.restapi` 7.x. - ## Upgrading to `plone.restapi` 7.x The navigation endpoint has been refactored. @@ -28,7 +26,6 @@ Now its behavior is consistent regarding the `items` attribute. Now the `items` attribute is present, even if the element of the tree does not have child elements, in which case it will be an empty array. This might affect some logins via JavaScript, specifically if the condition is checking for the existence of the `items` attribute and expects it to be `undefined`. - ## Upgrading to `plone.restapi` 6.x `plone.restapi` 6.0.0 removes the `IAPIRequest` marker interface (). @@ -52,7 +49,6 @@ If you need to fix object IDs, you can do one of the following: We expect that most content actually will not be affected. See for more details. - ## Upgrading to `plone.restapi` 5.x `plone.restapi` 5.0.0 introduces the following breaking change: @@ -96,7 +92,6 @@ to: This change affects the `GET`, `PATCH`, and `POST` formats. It should only affect you if you use Volto. - ## Upgrading to `plone.restapi` 4.x `plone.restapi` 4.0.0 introduces the following breaking changes: @@ -106,7 +101,6 @@ It should only affect you if you use Volto. 3. Serialize widget parameters into a `widgetOptions` object instead of adding them to the top level of the schema property. 4. The vocabularies endpoint does no longer returns an `@id` for terms, the results are batched, and terms are now listed as `items` instead of `terms` to match other batched responses. - ### Serialization and Deserialization of fields with vocabularies The serialization of fields with vocabularies, such as `Choice`, now return the `token` and the `title` of the vocabulary term instead of the stored value. @@ -148,7 +142,6 @@ Deserialization accepts objects that contain a token, but also just the token or However, it is highly recommended to always use the token, as vocabulary terms may contain values that are not JSON serializable. - ### Choice and List fields return link to vocabulary instead of the values Choice and List fields using named vocabularies are now serialized with a `vocabulary` property, giving the URL of the `@vocabularies` endpoint for the vocabulary instead of including `choices`, @@ -185,7 +178,6 @@ New response: }, ``` - ### Serialize widget parameters into a `widgetOptions` object Serialize widget parameters into a `widgetOptions` object instead of adding them to the top level of the schema property. @@ -207,7 +199,6 @@ New response: } ``` - ### Example: Vocabularies Subjects Field The `subjects` field is now serialized as an `array` of `string` items using the `plone.app.vocabularies.Keywords` vocabulary. @@ -241,7 +232,6 @@ New response: } ``` - ### Example: Available Time Zones Field (vocabulary in `items`) Old response: @@ -297,7 +287,6 @@ New response: }, ``` - ### Example: Weekday Field (vocabulary in main property) Old response: @@ -371,7 +360,6 @@ New response: }, ``` - ### Vocabularies Endpoint The vocabularies endpoint no longer returns an `@id` for terms. @@ -412,10 +400,8 @@ New response: } ``` - ## Upgrading to `plone.restapi` 3.x - ### Image scales Image download URLs and image scale URLs are created using the UID-based URL formats. @@ -457,7 +443,6 @@ New Response: } ``` - ### `@sharing` endpoint The `available_roles` property in the response to a `GET` request to the `@sharing` endpoint has changed. @@ -515,22 +500,19 @@ Content-Type: application/json } ``` - ### Custom Content Deserializers If you have implemented custom content deserializers, you have to handle the new `create` keyword in the `__call__` method, which determines if deserialization is performed during object creation or while updating an object. Deserializers should only fire an `IObjectModifiedEvent` event if an object has been updated. They should not fire it when a new object has been created. -See [Dexterity content deserializer](https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/deserializer/dxcontent.py) for an example. - +See [Dexterity content deserializer](https://github.com/plone/plone.restapi/blob/main/src/plone/restapi/deserializer/dxcontent.py) for an example. ## Upgrading to `plone.restapi` 2.x `plone.restapi` 2.0.0 converts all datetime, DateTime and time objects to UTC before serializing. The translations endpoint becomes "expandable", which introduces the following breaking changes. - ### Translations Previously when using the `@translations` endpoint in `plone.restapi` 1.x, the endpoint returned a `language` key with the content object's language and a `translations` key with all its translations. @@ -575,7 +557,6 @@ Content-Type: application/json } ``` - ## Upgrading to `plone.restapi` 1.0b1 In `plone.restapi` 1.0b1 the `url` attribute on the {ref}`navigation` and {ref}`breadcrumbs` endpoint was renamed to `@id` to be consistent with other links/URLs used in `plone.restapi`. @@ -728,7 +709,6 @@ Pull Request: - - ## Upgrading to `plone.restapi` 1.0a25 `plone.restapi` 1.0a25 introduced three breaking changes: @@ -739,7 +719,6 @@ Pull Request: - Convert `richtext` using `.output_relative_to`. Direct conversion from `RichText` is no longer supported as we _always_ need a context for the `ITransformer`. [jaroel] - ### Remove @components endpoint `plone.restapi` 1.0a25 removed the `@components` endpoint which used to provide a {ref}`navigation` and a {ref}`breadcrumbs` endpoint. @@ -777,7 +756,6 @@ Pull Request: - - ### Remove `sharing` attribute The `sharing` attribute was removed from all content `GET` responses: @@ -799,7 +777,6 @@ Pull Request: - - ### Convert `richtext` using `.output_relative_to` Use `.output_relative_to` to convert `richtext`. @@ -813,7 +790,6 @@ Pull Request: - - ## Upgrading to `plone.restapi` 1.0a17 `plone.restapi` 1.0a17 changed the serialization of the `richtext` "text" field for content objects from using `raw` (a Unicode string with the original input markup):