Open
Description
Currently, the structure of Decorator
and FieldItem
data
fields is the wild west - you pass the JSON values directly to the model with no guardrails preventing invalid or extraneous values. As we start to consider migration tools, these constraints will become vital - for example, plugins can use them to determine if an upgrade will break any existing FieldItems
or Decorators
. It also provides a path for migration of these data
columns. Additionally, it makes these structures self-documenting and far easier to work with and comprehend.
We have a few choices at our disposal. We could allow core & plugins to:
- build DSLs for each structure using Docile (likely the most idiomatic approach)
- define JSON Schemas for each structure using ruby-json-schema (likely less overhead, more portable to other languages should they want to reflect on these structures)
Let's discuss the pros/cons of each in more detail here before we come to a decision.