Skip to content

Feat: Schema datatypes validation by pydantic #478

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 9 commits into from
Aug 23, 2021

Conversation

mtovts
Copy link
Contributor

@mtovts mtovts commented Aug 17, 2021

A little suggestion for type checking in the Schema: Looks like it is a task for pydantic in input. This is more obvious and allows to reduce test cases.

@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #478 (b8d0aba) into main (75c69f0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #478   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        48    +1     
  Lines         1588      1596    +8     
=========================================
+ Hits          1588      1596    +8     
Impacted Files Coverage Δ
...penapi_python_client/parser/properties/__init__.py 100.00% <100.00%> (ø)
openapi_python_client/schema/__init__.py 100.00% <100.00%> (ø)
openapi_python_client/schema/data_type.py 100.00% <100.00%> (ø)
...on_client/schema/openapi_schema_pydantic/schema.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75c69f0...b8d0aba. Read the comment docs.

@mtovts
Copy link
Contributor Author

mtovts commented Aug 18, 2021

Returned tests for bad properties/additional_properties. Firstly thought it is about types. Now, instead of bad types, non-existent references are used.

Copy link
Collaborator

@dbanty dbanty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change, definitely improves the clarity of what's expected. Just would like to still point at 3.0.3 spec since we don't support 3.1.0 yet.

@mtovts mtovts requested a review from dbanty August 23, 2021 08:03
@dbanty dbanty merged commit 2d74640 into openapi-generators:main Aug 23, 2021
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