Hello All,
I am looking to figure out a somewhat sensible way to create a tool like a form builder. What I am looking to achieve is to allow for user generated forms, however I am struggling with how I should approach the structure in the api and in the db side. So far I have just have a blueprint json column, which would just be parsed into a map[interface], however I would much prefer something more on the lines of a struct.
So I am unsure if I should just try to create the structs at runtime some how or do something a little different. I was thinking of doing something similar to EAV, but instead of 1 field = 1 row, it will be 1 row has a json column with the form fields in side of a json list like: [{ "Name": "", "Type": "", "Value", "Validation": "" }, ...etc] and then via the "type" I can cast the values, and in the validation I can insert some form of logic ( jsonlogic lib or something like omniparser lib) would this make sense or are there better patterns for this?
( I am just jumping into go, trying to re-write a few api's I have built in it, so I am more familiar with python, in python I kept the normal json structure with no types, and had a separate config json for validation and types to generate a pydantic model at runtime )