Skip to content

Data Display Object Conditional "text" fields #6

@JaceHensley

Description

@JaceHensley

Sometimes what's in the JSON isn't meant to be human readable and instead of showing that to the user you'd want to show a human readable value based on the value in the JSON. Given the JSON:

{
  "status": "no_match"
}

you'd want to display to the user:

Status: No Match

the logic we'd want to represent in the Display Object to be:

if (status === "no_match") {
  return "No Match"
} else if (status === "match") {
  return "Match"
}

One idea is to allow "text" to be a string or array of objects that look like this:

{
  "text": [
    {
      "path": [""], // path(s) of property to test
      "schema": {
        // JSON Schema to test the path
      },
      "text": ""
    }
  ]
}

"text" would be an ordered array where the last item could optionally just contain "text" as a fallback/else

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions