-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Improve API documentation, in particular more links between usage and API docs #6780
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
Conversation
Deploying with
|
| Latest commit: |
10d8242
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c0ac2c55.pydantic-docs2.pages.dev |
| Branch Preview URL: | https://docs-links.pydantic-docs2.pages.dev |
|
please review. |
| show_root_heading: true | ||
| merge_init_into_class: false | ||
| group_by_category: false | ||
| # explicit members list so we can set order and include `__init__` easily |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean that if we add __init__, then it's going to be the last?
We need to remember to add methods here when we implement them, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we need to add them.
We can use some very special regex to include __init__ but not other dunder attributes, but the order is still very confusing. I think since this is a very important bit of the API documentation, it's worth getting it as good as possible even if that means adding members manually.
| @@ -670,7 +675,9 @@ def Field( # noqa: C901 | |||
| max_length: int | None = _Unset, | |||
| **extra: Unpack[_EmptyKwargs], | |||
| ) -> Any: | |||
| """Create a field for objects that can be configured. | |||
| """Usage docs: https://docs.pydantic.dev/dev-v2/usage/fields | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change some to 2.0 and some you added dev-v2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are all 2.0, should probably be changed to 2.1 if these changes are going to be released in the next minor release.
The point is we can't just use latest or dev-v2 since it'll be wrong for someone reading 2.0.3 code in 6 months time, or 6 years time 🤯.
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Improving docs, mostly API docs and links to API docs.
Selected Reviewer: @Kludex