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

String fields nether validated nor casted #45

Closed
Tishka17 opened this issue Mar 20, 2021 · 1 comment
Closed

String fields nether validated nor casted #45

Tishka17 opened this issue Mar 20, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Tishka17
Copy link

Tishka17 commented Mar 20, 2021

I am decalring class with str field. I expect, that after parsing it will contain only str data. Possibilites are: cast any other types to str or raise a validation error during parsing. None of this happends

E.G, this code works and obj.id will be a list though it is declared as str

@dataclass
class MashumaroTodo(DataClassDictMixin):
    id: str


obj = MashumaroTodo.from_dict({"id": ["invalid data"]})
@Fatal1ty Fatal1ty added the duplicate This issue or pull request already exists label Mar 20, 2021
@Fatal1ty
Copy link
Owner

#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants