Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better errors #14

Open
7 of 8 tasks
playpauseandstop opened this issue Oct 8, 2019 · 4 comments
Open
7 of 8 tasks

Better errors #14

playpauseandstop opened this issue Oct 8, 2019 · 4 comments
Assignees
Labels
feat A new feature openapi Issue or pull request related to OpenAPI code
Milestone

Comments

@playpauseandstop
Copy link
Owner

playpauseandstop commented Oct 8, 2019

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
@playpauseandstop playpauseandstop added the feat A new feature label Oct 8, 2019
@playpauseandstop playpauseandstop added this to the 2.0 milestone Oct 8, 2019
@playpauseandstop playpauseandstop self-assigned this Oct 8, 2019
@playpauseandstop playpauseandstop changed the title Better validation errors Better errors Dec 22, 2019
playpauseandstop added a commit that referenced this issue Jan 21, 2020
With given commit provide a better way to handle security & request
parameters validation errors.

This also results in ability enable CORS / Error Middleware for
`aiohttp.web` application via `setup_openapi` function.

Issue: #14
Issue: #22
playpauseandstop added a commit that referenced this issue Jan 21, 2020
…st error.

As it might be useful to respond 404 with some other message that default
"<object> not found".

Issue: #14
playpauseandstop added a commit that referenced this issue Jan 21, 2020
Allow to handle multiple errors as well as provide more error details
for request body validation errors.

Issue: #14
playpauseandstop added a commit that referenced this issue Jan 21, 2020
Simplify a way for user to supply custom validation error from dictionary
data as done in many other web-frameworks.

Issue: #14
playpauseandstop added a commit that referenced this issue Jan 21, 2020
Also allow passing kwargs to `ValidationError.from_dict` class method.

Issue: #14
playpauseandstop added a commit that referenced this issue Jan 27, 2020
Previously validation error on response resulted in 500 Server Error
responses, this commit fixes it and retursn 422 Unprocessable Entity
responses with data similar to Request Validation Error.

Issue: #14
playpauseandstop added a commit that referenced this issue Jan 29, 2020
…lds.

Unfortunately as `openapi-core` does not iter over all validation errors
it is not possible to return all validation errors in case of multiple
missed required files.

Issue: #14
@playpauseandstop
Copy link
Owner Author

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

@playpauseandstop playpauseandstop added the openapi Issue or pull request related to OpenAPI code label Apr 6, 2020
@playpauseandstop
Copy link
Owner Author

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

@playpauseandstop playpauseandstop modified the milestones: 2.0, 2.1 Apr 10, 2020
@playpauseandstop
Copy link
Owner Author

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.

@daidoji
Copy link

daidoji commented Mar 3, 2021

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

@playpauseandstop playpauseandstop modified the milestones: 3.0, 4.0 Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat A new feature openapi Issue or pull request related to OpenAPI code
Projects
None yet
Development

No branches or pull requests

2 participants