Skip to content
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

add dataclass_transform to enable better typehints #1094

Closed
landeholt opened this issue Feb 23, 2024 · 0 comments · Fixed by #1165
Closed

add dataclass_transform to enable better typehints #1094

landeholt opened this issue Feb 23, 2024 · 0 comments · Fixed by #1165

Comments

@landeholt
Copy link

Is your feature request related to a problem? Please describe.
When you inherit modelmetaclass, the dataclass_transform decorator gets lost, resulting in LSP not being able to source fields for schemas

Describe the solution you'd like

add @dataclass_transformer(kw_only_default=True, field_specifiers=(Field,)) to the new metaclass here:

class ResolverMetaclass(ModelMetaclass):

Can either be sourced from pydantic or dataclasses. Field is the schema field.

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 a pull request may close this issue.

1 participant