Skip to content

Commit

Permalink
stop overriding request.json_body from webob
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Jan 5, 2019
1 parent d00d868 commit 6de6df2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -31,6 +31,10 @@ Features
to ``add_route`` is the empty string (``''``).
See https://github.com/Pylons/pyramid/pull/3420

- No longer define ``pyramid.request.Request.json_body`` which is already
provided by WebOb. This allows the attribute to now be settable.
See https://github.com/Pylons/pyramid/pull/3447

Bug Fixes
---------

Expand Down
11 changes: 0 additions & 11 deletions docs/api/request.rst
Expand Up @@ -283,17 +283,6 @@

.. automethod:: resource_path

.. attribute:: json_body

This property will return the JSON-decoded variant of the request
body. If the request body is not well-formed JSON, or there is no
body associated with this request, this property will raise an
exception.

.. seealso::

See also :ref:`request_json_body`.

.. method:: set_property(callable, name=None, reify=False)

Add a callable or a property descriptor to the request instance.
Expand Down
2 changes: 1 addition & 1 deletion docs/narr/webob.rst
Expand Up @@ -287,7 +287,7 @@ that has a body suitable for reading via ``request.json_body`` using Python's
import json
json_payload = json.dumps({'a':1})
headers = {'Content-Type':'application/json; charset=utf-8'}
headers = {'Content-Type':'application/json'}
req = urllib2.Request('http://localhost:6543/', json_payload, headers)
resp = urllib2.urlopen(req)
Expand Down
5 changes: 0 additions & 5 deletions src/pyramid/request.py
@@ -1,5 +1,4 @@
from collections import deque
import json

from zope.interface import implementer
from zope.interface.interface import InterfaceClass
Expand Down Expand Up @@ -229,10 +228,6 @@ def is_response(self, ob):
return False
return adapted is ob

@property
def json_body(self):
return json.loads(text_(self.body, self.charset))


def route_request_iface(name, bases=()):
# zope.interface treats the __name__ as the __doc__ and changes __name__
Expand Down

0 comments on commit 6de6df2

Please sign in to comment.