def reconstruct(cls, resource, description): description['schema'] = Field.reconstruct(description['schema']) for status, response in description['responses'].items(): response['schema'] = Field.reconstruct(response['schema']) description['responses'][status] = Response(**response) return cls(resource, **description)
def _parse_resource(self, resource): schema = resource.get('schema') if isinstance(schema, dict): for name, field in schema.items(): schema[name] = Field.reconstruct(field) requests = resource.get('requests') if isinstance(requests, dict): for request in requests.itervalues(): request['schema'] = Field.reconstruct(request['schema']) for response in request['responses'].itervalues(): response['schema'] = Field.reconstruct(response['schema'])