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
Is your feature request related to a problem? Please describe.
If we use basic types like str, int, float, bool as a serialization method, the generated JSON Schema will use Any because they don't have signature:
str
int
float
bool
Any
from dataclasses import dataclass from yarl import URL from mashumaro.config import BaseConfig from mashumaro.jsonschema import build_json_schema @dataclass class Foo: bar: URL class Config(BaseConfig): serialization_strategy = { URL: { "serialize": str } } print(build_json_schema(Foo).to_json()) # {"type":"object","title":"Foo","properties":{"bar":{}},"additionalProperties":false,"required":["bar"]}
UserWarning: Type Any will be used for __main__.Foo.bar with overridden serialization method: no signature found for builtin type <class 'str'>
Describe the solution you'd like Treat str, int, float, bool types as functions returning the same type.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
If we use basic types like
str
,int
,float
,bool
as a serialization method, the generated JSON Schema will useAny
because they don't have signature:Describe the solution you'd like
Treat
str
,int
,float
,bool
types as functions returning the same type.The text was updated successfully, but these errors were encountered: