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 from mashumaro.config import BaseConfig from mashumaro.jsonschema import build_json_schema def as_str(value) -> str: return str(value) class Bar: pass @dataclass class Foo: bar: Bar = Bar() class Config(BaseConfig): serialization_strategy = { Bar: { "serialize": as_str, "deserialize": Bar, } } print(build_json_schema(Foo).to_json())
will raise an exception: mashumaro.exceptions.UnserializableField: Field "x" of type Bar in _default.<locals>.CC is not serializable
mashumaro.exceptions.UnserializableField: Field "x" of type Bar in _default.<locals>.CC is not serializable
Expected:
{ "type": "object", "title": "Foo", "properties": { "bar": { "type": "string", "default": "<__main__.Bar object at 0x1006e54d0>" } }, "additionalProperties": false }
The text was updated successfully, but these errors were encountered:
Fatal1ty
Successfully merging a pull request may close this issue.
Description
will raise an exception:
mashumaro.exceptions.UnserializableField: Field "x" of type Bar in _default.<locals>.CC is not serializable
Expected:
The text was updated successfully, but these errors were encountered: