We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The @validates_schema decorator does not work when the Schema is loaded.
@dataclass_json @dataclass class Person: name: str = field( metadata=config( mm_field=fields.String(required=True, validate=validate.Length(min=1, max=15)) ) ) surname: str = field( metadata=config( mm_field=fields.String( validate=validate.Length(min=3, max=15) ) ) ) @validates_schema() def validate_user_auth(self, data: dict, **kwargs) -> None: print('not working...') def save(self): print('db value:', self.name) if __name__ == '__main__': try: value = Person.schema().loads('{"name": "1", "surname": "abd"}') except ValidationError as e: print(e.messages) else: print(value.name, ":", value.surname)
the function: validate_user_auth should be called.
3.12
marshmallow==3.20.2 dataclasses-json==0.6.4
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
The @validates_schema decorator does not work when the Schema is loaded.
Code snippet that reproduces the issue
Describe the results you expected
the function: validate_user_auth should be called.
Python version you are using
3.12
Environment description
marshmallow==3.20.2
dataclasses-json==0.6.4
The text was updated successfully, but these errors were encountered: