Skip to content

Conversation

@sydney-runkle
Copy link
Contributor

@sydney-runkle sydney-runkle commented Oct 10, 2024

Closes #7580

At first, thought we might have to add a flag to fix this. The way I feel about adding flags at this point is about how edna (from The Incredibles) feels about capes.

Luckily, was able to sidestep the need for a flag by exposing the sort method as a public one in the GenerateJsonSchema class.

Did a little bit of refactoring to make things more type checking friendly re the outer sort vs recursive sorts. I did the move -> public and refactoring in different commits, so should be easy to review. Also added a docs example to expose the customizability here. Yay for empowered users!

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 10, 2024

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 12cc428
Status: ✅  Deploy successful!
Preview URL: https://756056c8.pydantic-docs.pages.dev
Branch Preview URL: https://sorting-for-good-hopefully.pydantic-docs.pages.dev

View logs

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 10, 2024

CodSpeed Performance Report

Merging #10595 will not alter performance

Comparing sorting-for-good-hopefully (12cc428) with main (09ade35)

Summary

✅ 38 untouched benchmarks

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2024

Coverage report

Image Image

Click to see where and how coverage changed

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

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

Copy link
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

LGTM

@sydney-runkle sydney-runkle merged commit 07e2b72 into main Oct 10, 2024
2 checks passed
@sydney-runkle sydney-runkle deleted the sorting-for-good-hopefully branch October 10, 2024 15:39
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.

Order of keys differs in schema output

4 participants