tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

pydantic_model_creator not validates JSONField

Open aub9999 opened this issue 3 years ago • 1 comments

when creating a pedantic model with pydantic_model_creator, the JSON fields are not enforced and validated on pedantic.

I found in the source code https://github.com/tortoise/tortoise-orm/blob/4a81c051d2d8082839a8f15b0f332220e753ea27/tortoise/contrib/pydantic/creator.py#L402 that it specifies type of Any instead of pydantic.Json[Any]

aub9999 avatar Sep 13 '22 22:09 aub9999

A PR is welcome!

long2ice avatar Sep 14 '22 00:09 long2ice