Skip to content

Schema/DSL for Decorators + FieldItems #549

Description

@toastercup

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions