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
from dataclasses import dataclass import desert @dataclass class A: some_string: str @dataclass class B: prop_one: A prop_two: A if __name__ == "__main__": schema = desert.schema_class(B)() prop_one_schema = schema.fields["prop_one"].schema prop_two_schema = schema.fields["prop_two"].schema print(isinstance(prop_one_schema, prop_one_schema.__class__)) # True print(isinstance(prop_one_schema, prop_two_schema.__class__)) # False print(isinstance(prop_two_schema, prop_one_schema.__class__)) # False print(isinstance(prop_two_schema, prop_two_schema.__class__)) # True
For the same class A there are as many schema classes as there are properties of type A.
This is inefficient (uses up more memory than needed) and can cause problems with other libraries, such as https://github.com/marshmallow-code/apispec which uses the schema class and modifiers to determine schema equality.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For the same class A there are as many schema classes as there are properties of type A.
This is inefficient (uses up more memory than needed) and can cause problems with other libraries, such as https://github.com/marshmallow-code/apispec which uses the schema class and modifiers to determine schema equality.
The text was updated successfully, but these errors were encountered: