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

Fix #20 - nullable semantics with $ref, oneOf, anyOf, and allOf #57

Merged
merged 2 commits into from
Jan 7, 2023

Conversation

pyckle
Copy link

@pyckle pyckle commented Jan 5, 2023

Hi,

Thank you for the fantastic work on a schema validator. This project has helped me significantly in validating dynamically generated openapi schemas.

Please consider merging this small improvement in handling nullable behavior.

The root of #20 seems to be that if a schema node is a meta node ($ref, allOf, anyOf, or oneOf), nullable shouldn't be checked.

The tests added validate both that null is allows when nullable:true the destination schema, and not allowed when nullable:false is on the destination schemas.

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #57 (5b8e47b) into master (553d606) will decrease coverage by 0.51%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
- Coverage   78.03%   77.51%   -0.52%     
==========================================
  Files           6        6              
  Lines         264      258       -6     
  Branches       41       40       -1     
==========================================
- Hits          206      200       -6     
  Misses         47       47              
  Partials       11       11              
Impacted Files Coverage Δ
openapi_schema_validator/validators.py 100.00% <ø> (ø)
openapi_schema_validator/_validators.py 73.78% <100.00%> (-1.45%) ⬇️

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

@p1c2u
Copy link
Collaborator

p1c2u commented Jan 7, 2023

Re-implemented nullable based on OAS 3.0.3 definition.

@p1c2u p1c2u merged commit 5ce7d30 into python-openapi:master Jan 7, 2023
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.

2 participants