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

@model_validator(mode="after") is not class methdod #774

Closed
koxudaxi opened this issue Aug 2, 2023 · 0 comments · Fixed by #779
Closed

@model_validator(mode="after") is not class methdod #774

koxudaxi opened this issue Aug 2, 2023 · 0 comments · Fixed by #779

Comments

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 2, 2023

Describe the bug

@model_validator(mode="after") decorates an instance method instead of a class method that receives the raw values (the case for mode="before").

Related Issues: koxudaxi/datamodel-code-generator#1448

https://docs.pydantic.dev/latest/usage/validators/#model-validators

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
@model_validator(mode="after") work as instance method

Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.

Environments (please complete the following information):

  • IDE: [e.g. PyCharm Community 2022.1 ]
  • OS: [e.g. macOS 12.2.0 ]
  • Pydantic Version [e.g. 1.9.0 ]
  • Plugin version [e.g. 0.3.11 ]

Additional context
Add any other context about the problem here.

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