Support Pydantic model defaults + field descriptions#802
Merged
mhils merged 69 commits intomitmproxy:mainfrom Oct 27, 2025
Merged
Support Pydantic model defaults + field descriptions#802mhils merged 69 commits intomitmproxy:mainfrom
mhils merged 69 commits intomitmproxy:mainfrom
Conversation
mhils
reviewed
May 2, 2025
Member
mhils
left a comment
There was a problem hiding this comment.
Thanks!
Should Pydantic support for pdoc be split out into a separate "plugin" package, e.g. pdoc-pydantic or pdoc[pydantic]?
Too much complexity for now. I think pydantic is popular enough to have support for it builtin for now.
Is this the best place for default-value-extraction logic for Pydantic classes to live?
Pragmatically yes. See my comments below on how we can keep things reasonably clean.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
jinnovation
commented
Oct 11, 2025
jinnovation
commented
Oct 11, 2025
jinnovation
commented
Oct 19, 2025
jinnovation
commented
Oct 19, 2025
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This reverts commit efaafcd.
Contributor
Author
|
@mhils: Ready for your review again whenever you've the time! |
mhils
approved these changes
Oct 27, 2025
Member
mhils
left a comment
There was a problem hiding this comment.
Thank you! This looks fantastic now, I'll take over from here on 😃 🍰
Contributor
Author
Thank you for the super comprehensive review. 😇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Contributes to #793.
This PR implements quick-and-dirty support for Pydantic-style default values and field descriptions. In other words, the following two classes will render equivalently:
Open questions:
pdoc-pydanticorpdoc[pydantic]?