def call_view(self, *args, **kwargs): config = flask.current_app.config parser = config.get('APISPEC_WEBARGS_PARSER', flaskparser.parser) annotation = utils.resolve_annotations(self.func, 'args', self.instance) if annotation.apply is not False: for option in annotation.options: schema = utils.resolve_instance(option['args']) parsed = parser.parse(schema, locations=option['kwargs']['locations']) kwargs.update(parsed) return self.func(*args, **kwargs)
def marshal_result(self, unpacked, status_code): config = flask.current_app.config format_response = config.get('APISPEC_FORMAT_RESPONSE', flask.jsonify) or identity annotation = utils.resolve_annotations(self.func, 'schemas', self.instance) schemas = utils.merge_recursive(annotation.options) schema = schemas.get(status_code, schemas.get('default')) if schema and annotation.apply is not False: schema = utils.resolve_instance(schema['schema']) output = schema.dump(unpacked[0]).data else: output = unpacked[0] return format_output((format_response(output), ) + unpacked[1:])
def get_parent(self, resource, **kwargs): return resolve_instance(resource, **kwargs)
def get_parent(self, resource): return resolve_instance(resource)