Skip to content

fix(pydantic): model_validate_json causing code break with pydantic v1 #609

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
Jun 17, 2025

Conversation

silentworks
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix: Add model_validate_json methods which works with both pydantic v1 and v2

What is the current behavior?

An error is thrown if you use pydantic v1 with this library

What is the new behavior?

The library is now compatible with both pydantic v1 and v2

Additional context

Fixes #608

…ntic v1

Add model_validate_json methods which works with both pydantic v1 and v2
@silentworks silentworks requested a review from grdsdev as a code owner June 17, 2025 13:42
@silentworks silentworks changed the title fix(pydantic): add pydantic v1 and v2 compatible model_validate_json fix(pydantic): model_validate_json causing code break with pydantic v1 Jun 17, 2025
@silentworks silentworks merged commit 587dcc8 into main Jun 17, 2025
12 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15708952945

Details

  • 12 of 13 (92.31%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 96.179%

Changes Missing Coverage Covered Lines Changed/Added Lines %
postgrest/utils.py 6 7 85.71%
Totals Coverage Status
Change from base Build 15707682718: -0.04%
Covered Lines: 1888
Relevant Lines: 1963

💛 - Coveralls

@silentworks silentworks deleted the silentworks/fix-pydantic-issue branch June 17, 2025 14:10
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.

Latest version break with pydantic < 2
3 participants