Skip to content

fix: Support Field defined via typing_extensions.Annotated - #58

Merged
pawamoy merged 2 commits into
mkdocstrings:mainfrom
MarshalX:fix-typing-extensions-annotated
Aug 29, 2026
Merged

pawamoy merged 2 commits into
mkdocstrings:mainfrom
MarshalX:fix-typing-extensions-annotated

Conversation

@MarshalX

Copy link
Copy Markdown
Contributor

For reviewers

  • I did not use AI
  • I used AI and thoroughly reviewed every code/docs change

Description of the change

#46 checks canonical_path == "typing.Annotated", so typing_extensions.Annotated[int, Field(description="...", le=10)] never enters that branch. The description and constraints are dropped.

Now matches typing_extensions.Annotated too. New test mirrors test_annotated_fields with typing_extensions, and also asserts that a constraint declared inside Annotated is collected.

Relevant resources

@pawamoy pawamoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like a no-brainer, thanks 🙂

Comment thread tests/test_extension.py Outdated
Comment thread tests/test_extension.py Outdated
@pawamoy
pawamoy merged commit 2c701f9 into mkdocstrings:main Aug 29, 2026
0 of 34 checks passed
@MarshalX
MarshalX deleted the fix-typing-extensions-annotated branch August 29, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants