Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from lendingblock/master
Browse files Browse the repository at this point in the history
schema can be string or class
  • Loading branch information
lsbardel authored Jun 20, 2018
2 parents 24517d9 + 32bde55 commit c348916
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Minimal OpenAPI asynchronous server application
"""
__version__ = '0.1.3'
__version__ = '0.1.4'
10 changes: 7 additions & 3 deletions openapi/spec/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ def cleaned(self, name, data, strict=True):
raise web.HTTPUnprocessableEntity(**self.api_response_data(errors))
return schema.data

def dump(self, name, data):
"""call clean for now"""
Schema = getattr(self.request['operation'], name, None)
def dump(self, schema, data):
"""Dump data using a given schema
"""
if isinstance(schema, str):
Schema = getattr(self.request['operation'], schema, None)
else:
Schema = schema
if Schema is None:
raise web.HTTPNotImplemented
if isinstance(Schema, list):
Expand Down

0 comments on commit c348916

Please sign in to comment.