Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
aiohttp parser breaks with more than one argument #165
Nothing seems to work once I add more than one field. Here's my minimal example.
I'm validating with:
and here's what happens when I POST:
Things work fine if there's only one argument.
After quite some digging, found out that in
def parse_json(self, req, name, field): """Pull a json value from the request.""" if not (req.has_body and is_json_request(req)): return core.missing json_data = self._cache.get('json') if json_data is None: self._cache['json'] = json_data = yield from req.json() return core.get_value(json_data, name, field, allow_many_nested=True)
req.has_body is true only on the first invocation, and false for the rest. In my case it's 3 arguments and only the first one gets parsed, in the following two it is false, and the parameter is considered missing.