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
Steps to reproduce:
from dataclasses import dataclass from typing import Optional from apischema import deserialize @dataclass class Categories: Name: str Url: str @dataclass class Item: Name: str Domain: str Categories: Optional[list[Categories]] = None item = deserialize(Item, {'Name': 'name', 'Domain': 'domain', 'Categories': [{'Name': 'name', 'Url': 'url'}]})
this is a kind of edge case but Python allows us to declare in this way and it's a bit tricky to debug
Workaround:
from dataclasses import dataclass from typing import Optional from apischema import deserialize @dataclass class Category: Name: str Url: str @dataclass class Item: Name: str Domain: str Categories: Optional[list[Category]] = None item = deserialize(Item, {'Name': 'name', 'Domain': 'domain', 'Categories': [{'Name': 'name', 'Url': 'url'}]})
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to reproduce:
this is a kind of edge case but Python allows us to declare in this way and it's a bit tricky to debug
Workaround:
The text was updated successfully, but these errors were encountered: