Skip to content

Commit

Permalink
Merge pull request #230 from macisamuele/maci-ensure-that-renderer-us…
Browse files Browse the repository at this point in the history
…es-operation-as-optional

Gracefully handle operation attribute not set in request during rendering
  • Loading branch information
macisamuele committed May 24, 2018
2 parents 4075554 + 0a1a7fb commit 37434f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyramid_swagger/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, renderer_factory=JSON()):

def _marshal_object(self, request, response_object):
# operation attribute is injected by validator_tween in case the endpoint is served by Swagger 2.0 specs
operation = getattr(request, 'operation')
operation = getattr(request, 'operation', None)

if not operation:
# If the request is not served by Swagger2.0 endpoint _marshal_object is NO_OP
Expand Down

0 comments on commit 37434f6

Please sign in to comment.