plone.restapi/expansion: Add deprecation message on @components endpoint. Enable depr

Timo Stollenwerk <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: plone.restapi
Branch: refs/heads/expansion
Date: 2017-07-16T12:06:34+02:00
Author: Timo Stollenwerk (tisto) <[email protected]>
Commit: https://github.com/plone/plone.restapi/commit/62464fd442439eea80712c5452b1aa085ec6b84d

Add deprecation message on @components endpoint. Enable deprecation messages on buildout.

Files changed:
M base.cfg
M src/plone/restapi/services/components/get.py

diff --git a/base.cfg b/base.cfg
index 342d5385..3ff9311f 100644
--- a/base.cfg
+++ b/base.cfg
@@ -21,6 +21,7 @@ auto-checkout =
 recipe = plone.recipe.zope2instance
 user = admin:admin
 http-address = 8080
+deprecation-warnings = on
 eggs =
     Plone
     Pillow
diff --git a/src/plone/restapi/services/components/get.py b/src/plone/restapi/services/components/get.py
index 61502c7e..5947d0c3 100644
--- a/src/plone/restapi/services/components/get.py
+++ b/src/plone/restapi/services/components/get.py
@@ -2,6 +2,7 @@
 from plone.restapi.services import Service
 from plone.restapi.services.components.breadcrumbs import Breadcrumbs
 from plone.restapi.services.components.navigation import Navigation
+from zope.deprecation import deprecate
 from zope.interface import implements
 from zope.publisher.interfaces import IPublishTraverse
 
@@ -47,6 +48,10 @@ def _render_component(self, component_id):
 
         return self._wrap_component_items(items, component_id)
 
+    @deprecate(
+        'The "@components" endpoint is deprecated. Please call the '
+        '"@breadcrumbs" and the "@navigation" endpoints on the site root.'
+    )
     def reply(self):
         components = []
         for component_id in self._component_ids:



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.