Skip to content

Validation errors refactor #473

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

Merged
merged 1 commit into from
Jan 23, 2023
Merged

Conversation

p1c2u
Copy link
Collaborator

@p1c2u p1c2u commented Jan 20, 2023

Fixes #246

  • All validation exceptions are subclasses of ValidationError
  • All schema validation exceptions are subclass of ValidateError
  • All request validation exceptions are subclass of RequestError
  • All response validation exceptions are subclass of ResponseError
  • ParameterError exceptions have name and location values.
  • HeaderError exceptions have name value.

Backward compatibilities:

  • Schema unmarshalling/validation returns Invalid* exception (InvalidData, InvalidParameter, InvalidRequestBody, InvalidHeader). Use __cause__ property to get root cause exception.
  • InvalidSecurity exception renamed to SecurityNotFound

@p1c2u p1c2u force-pushed the refactor/validation-errors-refactor branch 4 times, most recently from c3e6eec to e63e02f Compare January 21, 2023 01:25
@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Merging #473 (02590a4) into master (dcc431c) will increase coverage by 0.11%.
The diff coverage is 93.97%.

@@            Coverage Diff             @@
##           master     #473      +/-   ##
==========================================
+ Coverage   92.19%   92.31%   +0.11%     
==========================================
  Files         103      105       +2     
  Lines        2856     2939      +83     
  Branches      243      249       +6     
==========================================
+ Hits         2633     2713      +80     
- Misses        182      185       +3     
  Partials       41       41              
Impacted Files Coverage Δ
openapi_core/validation/exceptions.py 87.50% <50.00%> (-6.95%) ⬇️
openapi_core/security/providers.py 82.35% <60.00%> (ø)
openapi_core/validation/request/exceptions.py 88.00% <87.87%> (-3.31%) ⬇️
openapi_core/validation/response/exceptions.py 92.85% <88.88%> (-0.48%) ⬇️
openapi_core/validation/request/validators.py 88.58% <96.66%> (+0.90%) ⬆️
openapi_core/contrib/django/handlers.py 100.00% <100.00%> (ø)
openapi_core/contrib/falcon/handlers.py 100.00% <100.00%> (ø)
openapi_core/contrib/flask/handlers.py 100.00% <100.00%> (ø)
openapi_core/security/exceptions.py 100.00% <100.00%> (ø)
openapi_core/templating/security/exceptions.py 100.00% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@p1c2u p1c2u force-pushed the refactor/validation-errors-refactor branch 7 times, most recently from 9bfcf1c to 13bde41 Compare January 23, 2023 09:56
@p1c2u p1c2u force-pushed the refactor/validation-errors-refactor branch from 13bde41 to 02590a4 Compare January 23, 2023 10:16
@p1c2u p1c2u merged commit 00ae628 into master Jan 23, 2023
@p1c2u p1c2u deleted the refactor/validation-errors-refactor branch January 23, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include parameter name in JSON Schema error path on unmarshalling
1 participant