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

Ensure minimums are same type as fields #146

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

DiamondJoseph
Copy link
Contributor

@DiamondJoseph DiamondJoseph commented Oct 9, 2024

Json schema generation seems to inconsistently use the minimum arguments with or without casting to the expected type when called from fastapi or not. Ensure that these arguments match the expected type.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.74%. Comparing base (e1220f5) to head (0fcbe3d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #146   +/-   ##
=======================================
  Coverage   95.74%   95.74%           
=======================================
  Files           9        9           
  Lines         940      940           
=======================================
  Hits          900      900           
  Misses         40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DiamondJoseph DiamondJoseph changed the title Ensure defaults are same type as fields Ensure minimums are same type as fields Oct 9, 2024
@ZohebShaikh
Copy link
Contributor

Would it be possible to add a test to verify the typecasting of field values of all the other Pydantic models?
This would be useful in identifying such cases in the future when similar changes are made.

@DiamondJoseph
Copy link
Contributor Author

Note that handling appears to be highly inconsistent between anything handling the json blob in a browser (where Javascript appears to truncate 0.0 to 0 regardless of whether the minimum is 0 or 0.0) or any "dumb" client where the form in the definition is respected.

@DiamondJoseph DiamondJoseph merged commit 4deecf8 into main Oct 9, 2024
24 checks passed
@DiamondJoseph DiamondJoseph deleted the Ensure-default-types-match branch October 9, 2024 14:49
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.

3 participants