Skip to content

Conversation

Dreamsorcerer
Copy link
Member

@Dreamsorcerer Dreamsorcerer commented Oct 4, 2025

This should help users avoid spelling mistakes etc.

models.append((key, "validation", TypeAdapter(ann_type)))
td[param_name] = Required[ann_type] if required else NotRequired[ann_type]
endpoints["query"] = TypeAdapter(TypedDict(query.__name__, td)) # type: ignore[attr-defined,operator]
endpoints["query"] = TypeAdapter(TypedDict(query.__name__, td), config={"extra": "forbid"}) # type: ignore[attr-defined,operator]
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
endpoints["query"] = TypeAdapter(TypedDict(query.__name__, td), config={"extra": "forbid"}) # type: ignore[attr-defined,operator]
endpoints["query"] = TypeAdapter(with_config({"extra": "forbid"})(TypedDict(query.__name__, td))) # type: ignore[attr-defined,operator]

Copy link
Member Author

Choose a reason for hiding this comment

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

from pydantic import with_config

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.

1 participant