diff --git a/openapi/__init__.py b/openapi/__init__.py index 72f4651..d3fe63b 100644 --- a/openapi/__init__.py +++ b/openapi/__init__.py @@ -1,3 +1,3 @@ """Minimal OpenAPI asynchronous server application """ -__version__ = '0.1.3' +__version__ = '0.1.4' diff --git a/openapi/spec/path.py b/openapi/spec/path.py index cc22fc1..80c496f 100644 --- a/openapi/spec/path.py +++ b/openapi/spec/path.py @@ -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):