Tagged union type for an attribute on a table
Hello.
I have a context field in my task table which would be a different JSON on the basis of task_type so I decided to use a union type to model this attribute, in the following way.
This is how I am creating my context during the task creation -
However, when I try to create the task, it logs the query for the task_creation and then silently rolls back. I only see this error which is not really clear to me. It says that it's not able to load the context type because it doesn't match any types but I am absolutely matching the structure.
What could be causing this? Any sort of guidance would be really helpful. Thank you.
I have a context field in my task table which would be a different JSON on the basis of task_type so I decided to use a union type to model this attribute, in the following way.
This is how I am creating my context during the task creation -
However, when I try to create the task, it logs the query for the task_creation and then silently rolls back. I only see this error which is not really clear to me. It says that it's not able to load the context type because it doesn't match any types but I am absolutely matching the structure.
What could be causing this? Any sort of guidance would be really helpful. Thank you.

Ash