Skip to content

Simplify customization of default value inclusion in JSON Schema generation #11634

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
Mar 27, 2025

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Mar 27, 2025

Add a new get_default_value() method, that can be used to choose which default value to use.

Change Summary

Fixes #11622.

Related issue number

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

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Mar 27, 2025
Copy link

cloudflare-workers-and-pages bot commented Mar 27, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f83330c
Status: ✅  Deploy successful!
Preview URL: https://3a4890e5.pydantic-docs.pages.dev
Branch Preview URL: https://js-default-value.pydantic-docs.pages.dev

View logs

Copy link
Contributor

github-actions bot commented Mar 27, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  json_schema.py
Project Total  

This report was generated by python-coverage-comment-action

@Viicos Viicos force-pushed the js-default-value branch from a5a39a1 to 6508432 Compare March 27, 2025 09:57
Copy link

codspeed-hq bot commented Mar 27, 2025

CodSpeed Performance Report

Merging #11634 will not alter performance

Comparing js-default-value (f83330c) with main (6f11161)

Summary

✅ 46 untouched benchmarks

@Viicos Viicos force-pushed the js-default-value branch 2 times, most recently from b918b46 to 7596fe0 Compare March 27, 2025 10:02
…ration

Add a new `get_default_value()` method, that can be used to choose
which default value to use.
@Viicos Viicos force-pushed the js-default-value branch from 7596fe0 to f83330c Compare March 27, 2025 10:02
@Viicos Viicos merged commit fcba832 into main Mar 27, 2025
62 checks passed
@Viicos Viicos deleted the js-default-value branch March 27, 2025 16:44
@Viicos Viicos added relnotes-feature and removed relnotes-fix Used for bugfixes. labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "default" in generated schema when default_factory is used
2 participants