Skip to content
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

how to config the pydantic JSON fields #1242

Open
1 task done
cjdxhjj opened this issue Dec 12, 2024 · 6 comments
Open
1 task done

how to config the pydantic JSON fields #1242

cjdxhjj opened this issue Dec 12, 2024 · 6 comments

Comments

@cjdxhjj
Copy link

cjdxhjj commented Dec 12, 2024

Privileged issue

  • I'm @tiangolo or he asked me directly to create an issue here.

Issue Content

image
image

@linpan
Copy link

linpan commented Dec 25, 2024

use json.

@linpan
Copy link

linpan commented Dec 25, 2024

data: dict = Field(default={}, sa_type=JSON)

@cjdxhjj
Copy link
Author

cjdxhjj commented Dec 25, 2024

However, it cannot be deserialized back to the Pydantic type normally.

@cjdxhjj
Copy link
Author

cjdxhjj commented Dec 25, 2024

i wonder is there any way provider an custom handler like mybatis BaseTypeHandler

@cjdxhjj
Copy link
Author

cjdxhjj commented Dec 25, 2024

Perhaps it can be automatically recognized by the framework.

@cjdxhjj
Copy link
Author

cjdxhjj commented Dec 25, 2024

there are only two data type for pydantic, the one is object and another is list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants