DEV Community

Discussion on: JSON Form Definition

Collapse
 
megazear7 profile image
megazear7

Nice finds! My original goal was to come up with something similar to GraphQL where you basically just specify the data exactly as you want to see it and then what you get back is the same data structure. However the more I have thought about it the more I realized that for a form you need to know more than just the data types and data hierarchy. Most of these libraries I have found went in the same direction.

If I were to create such a library I would try to maintain a few guidelines:

  1. The schema should be completely separated from the display of the form.
  2. Interpreting the form as a JSON object should be separated from generating the form from the schema.
  3. Layout and display configuration should be a library layered on top of these first items 1 and 2.

Many of these libraries I have found as well as the two you mentioned are very intriguing. I am thinking however that there is probably room for something new as I haven't found anything that meets the above three criteria.

Collapse
 
misterhtmlcss profile image
Roger K. • Edited

I bet what you are thinking is a little bit like how platforms like Wix likely (I suspect) work with their data/content.

I'd be game to work on it with you. Let me know. Otherwise good luck and share your progress!

Thread Thread
 
megazear7 profile image
megazear7

It looks like this is actually right on the money for what I was thinking about: github.com/json-editor/json-editor

It uses json-schema.org/ and then generates an HTML form and comes with integration capabilities with bootstrap, foundation, and jQueryUI.

I think this is actually perfect because it separates concerns it into three pieces:

  1. JSON Schema
  2. HTML Form Generation
  3. Integration with UI frameworks