def body_param(schema): return swagger.BodyParameter(**{ "name": "body", "in": "body", "schema": swagger.JsonReference({ "$ref": "#/definitions/{}".format(type_name(name_for(schema))), }), })
def build_response(description, resource=None): """ Build a response definition. """ response = swagger.Response(description=description, ) if resource is not None: response.schema = swagger.JsonReference({ "$ref": "#/definitions/{}".format(type_name(name_for(resource))), }) return response