playpauseandstop / rororo

Implement aiohttp.web OpenAPI 3 server applications with schema first approach.

Home Page:https://rororo.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better handling response data

playpauseandstop opened this issue · comments

When response is a tuple, but not a list, next exception raised,

  File "/Users/playpauseandstop/Projects/project/.venv/lib/python3.7/site-packages/rororo/schemas/schema.py", line 114, in make_response
    self._validate(data, response_schema)
  File "/Users/playpauseandstop/Projects/project/.venv/lib/python3.7/site-packages/rororo/schemas/schema.py", line 190, in _validate
    return self.validate_func(schema, self._pure_data(data))
  File "/Users/playpauseandstop/Projects/project/.venv/lib/python3.7/site-packages/rororo/schemas/schema.py", line 178, in _pure_data
    return dict(data)
ValueError: dictionary update sequence element #0 has length 3; 2 is required

This is not fully right as tuple can be validated by jsonschema similarly to list.

Closed as it not related to new rororo version.