Skip to content

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

Merged
Viicos merged 1 commit intomainfrom
js-default-value
Mar 27, 2025
Merged

Simplify customization of default value inclusion in JSON Schema generation#11634
Viicos merged 1 commit intomainfrom
js-default-value

Conversation

@Viicos
Copy link
Copy Markdown
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
@cloudflare-workers-and-pages
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown
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
@codspeed-hq
Copy link
Copy Markdown

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