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

Generate fully variant JSON schema type for columns of type JSON/JSONB #238

Closed
edgarrmondragon opened this issue Sep 18, 2023 · 0 comments · Fixed by #239
Closed

Generate fully variant JSON schema type for columns of type JSON/JSONB #238

edgarrmondragon opened this issue Sep 18, 2023 · 0 comments · Fixed by #239

Comments

@edgarrmondragon
Copy link
Member

edgarrmondragon commented Sep 18, 2023

Consider a JSONB column with the following values:

id (int) data (jsonb)
-------- ------------
1        {"nested": "data"}
2        ["an", "array"]
3        3.14

Then the currently generated object type will not cover all the possible values and potentially lead to schema validation errors downstream.

return th.ObjectType().type_dict

Should perhaps be updated to return an empty dict.

https://stackoverflow.com/a/57085989/5535114

@edgarrmondragon edgarrmondragon linked a pull request Sep 18, 2023 that will close this issue
@visch visch closed this as completed in #239 Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant