Skip to main content
← Back to list
01Issue
BugTriagedSwamp CLI
Assigneesstack72

Relationships

#620 Inconsistent resource-field accessor: data get returns content, data query and CEL use attributes

Opened by jentz · 6/11/2026

Description

The same resource's fields are addressed under different top-level keys depending on the command, with no alias, so applying the accessor learned from one command to the other silently yields nulls:

  • swamp data get <model> <spec> --json -> fields live under the top-level content key.
  • swamp data query '<pred>' --select '{ x: attributes.<field> }' and CEL expressions -> fields live under attributes.

Steps to reproduce

  1. Any model that writes a resource with, say, a field foo.
  2. swamp data get <model> <spec> --json returns { ..., "content": { "foo": ... } } — note the wrapper key is content.
  3. swamp data query 'modelName == "<model>" && specName == "<spec>"' --select '{ "foo": attributes.foo }' works only via attributes.foo.
  4. Using attributes.foo against the data get --json output (or content.foo in a --select) returns null with no error.

Expected

One consistent accessor for resource fields across data get, data query --select, and CEL — or at least an attributes alias exposed on data get --json (and/or content honored in --select), so the two are interchangeable.

Actual

data get exposes fields under content; data query / CEL use attributes. Mixing them produces silent nulls, costing a debugging round-trip.

Suggested fix

Alias the two (expose attributes on data get --json, or accept content in --select/CEL), or document the distinction prominently in both the swamp data get and swamp data query help and the data skill.

Environment

swamp 20260608.234005.0-sha.ed5f78a4.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW

Triaged

6/11/2026, 2:58:38 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/11/2026, 2:52:03 PM

Sign in to post a ripple.