async def get(self, request, args): return J(args)
async def get(self, request, name: str = "World"): return J({"name": name})
async def echo_cookie(request): return J(await parser.parse(hello_args, request, location="cookies"))
async def echo_path_param(request): parsed = await parser.parse({"path_param": fields.Int()}, request, location="path_params") return J(parsed)
async def echo_headers(request): # the "exclude schema" must be used in this case because WSGI headers may # be populated with many fields not sent by the caller return J(await parser.parse(hello_exclude_schema, request, location="headers"))
async def error(request): def always_fail(value): raise ma.ValidationError("something went wrong") args = {"text": fields.Str(validate=always_fail)} return J(await parser.parse(args, request))
async def echo_use_kwargs_with_path(request, value): return J({"value": value})
async def echo_use_args_with_path(request, args): return J(args)
async def many_nested(request): arguments = await parser.parse(hello_many_schema, request, location="json") return J(arguments)