-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Generate pydantic model from ormar.Model doesn't work for ormar.JSON fields #434
Comments
And what is the actual error message or what happens? |
|
@collerek I could look at the code and try to write a pull request. Tell me which place should I pay attention to? |
OK, I checked again and I forgot that this is actually how That's To verify (will fail): class AA(pydantic.BaseModel):
test: pydantic.Json
def test1():
aa = AA(test={'1': '1', '2': 2}) which is also verified by pydantic own tests: def test_valid_simple_json():
class JsonModel(BaseModel):
json_obj: Json
obj = '{"a": 1, "b": [2, 3]}' # <- note the string
assert JsonModel(json_obj=obj).dict() == {'json_obj': {'a': 1, 'b': [2, 3]}} |
Describe the bug
If I try to use
get_pydantic
for model with ormar.JSON field - it's failedTo Reproduce
Versions
pyproject.toml
The text was updated successfully, but these errors were encountered: