Skip to content

Commit

Permalink
Merge pull request #352 from antoineleclair/master
Browse files Browse the repository at this point in the history
Clarify docs for deferred colander validator
  • Loading branch information
almet committed Mar 1, 2016
2 parents 3975c49 + d2f7599 commit 37e2829
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/source/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ If you want to access the ``request`` within the schema nodes during validation,
you can use the `deferred feature of Colander <http://docs.pylonsproject.org/projects/colander/en/latest/binding.html>`_,
since Cornice binds the schema with the current request::

from colander import deferred

@deferred
def deferred_validator(node, kw):
request = kw['request']
if request['x-foo'] == 'version_a':
Expand Down

0 comments on commit 37e2829

Please sign in to comment.