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 errors

playpauseandstop opened this issue · comments

As of 2.0.0a2 version rororo does not provide any specific error message on validation error, it fully relies on openapi-core and later on which error middleware used in aiohttp.web application (if any).

Need to change this and return the predefined error response if some of request parameters or body is not valid (and same for response after #13 is done).

TODO:

  • Security error
  • Request parameter validation error
  • Request body validation error
  • Response validation error
  • Multiple validation errors
  • Multiple validation errors in case of missing multiple required fields
  • Allow to localize high level error messages
  • Documentation for error handling & custom errors

For a moment openapi-core==0.12.0 doesn't have an ability to provide an info about multiple validation errors, however master of openapi-core contains this feature, which means next version of openapi-core will allow rororo to fetch all available validation errors, not only first one.

Reference: python-openapi/openapi-core#178

As of openapi-core==0.13.3 it is able to provide details about multiple validation errors.

2.0.0rc0 contain solid base for handling errors, only localizing errors is still missing, but this shouldn't freeze the 2.0.0 release.

Is this issue still ongoing? I can't seem to figure out how to log request validation errors for this library.