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 model json schema with config types #9287

Merged

Conversation

NeevCohen
Copy link
Contributor

@NeevCohen NeevCohen commented Apr 19, 2024

Change Summary

Fixing an issue where a model would have a field with a default value being a pydantic type (BaseModel, datacalass, TypedDict), then generating the parent model's json schema would fail.

Related issue number

Fix #9253

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @dmontagu

Copy link

codspeed-hq bot commented Apr 19, 2024

CodSpeed Performance Report

Merging #9287 will not alter performance

Comparing NeevCohen:fix/model-json-schema-with-config-types (d285b3b) with main (77b0e1c)

Summary

✅ 13 untouched benchmarks

@NeevCohen
Copy link
Contributor Author

Please review

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Great work @NeevCohen. Awesome test as well. Merging now, this fix will be included in 2.7.1 soon!

@sydney-runkle sydney-runkle merged commit 82e4664 into pydantic:main Apr 22, 2024
53 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible problem with dataclasses.dataclass and calling model_json_schema()
3 participants