Skip to content

feat: enhance metadata capabilities - array support, increased limits #229

@ericfitz

Description

@ericfitz

Summary

The current metadata schema has limitations that constrain how structured data can be stored on diagram cells and other TMI objects.

Approved Design Direction

After analysis, the approved approach is:

  • value field becomes type: array, items: {type: string} — always an array, even for single values
  • DB stores JSON arrays in the value column — one-time migration converts existing plain strings to single-element JSON arrays
  • Widen DB column from varchar(1024) to varchar(4096)
  • Validation: max 1024 bytes per individual string, max 4096 bytes total for the serialized array
  • MinimalNode/MinimalEdge flattening: join array values with a delimiter for WebSocket
  • Breaking change: existing clients (tmi-ux) must update to send/receive arrays
  • No change to maxItems on any entity type

Open Question

  • Should the field be renamed from value to values since it is always an array?

Context

The tmi-tf Terraform analyzer stores component dependencies, security controls, and other structured data as metadata on diagram cells. With the current constraints, flat arrays of strings must be serialized as JSON-in-a-string or numbered key suffixes (dependency01-name, dependency02-name), which is fragile and not human-readable.

Current Schema

From tmi-openapi.json:

  • Key: maxLength 256, pattern ^[a-zA-Z0-9_./:-]+$
  • Value: maxLength 1024, minLength 1
  • Both required strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions