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-levelcontentkey.swamp data query '<pred>' --select '{ x: attributes.<field> }'and CEL expressions -> fields live underattributes.
Steps to reproduce
- Any model that writes a resource with, say, a field
foo. swamp data get <model> <spec> --jsonreturns{ ..., "content": { "foo": ... } }— note the wrapper key iscontent.swamp data query 'modelName == "<model>" && specName == "<spec>"' --select '{ "foo": attributes.foo }'works only viaattributes.foo.- Using
attributes.fooagainst thedata get --jsonoutput (orcontent.fooin a--select) returnsnullwith 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.
Closed
No activity in this phase yet.
stack72 commented 7/22/2026, 8:12:39 PM
We closed this out as part of https://github.com/swamp-club/swamp/pull/1928 - sorry this took so long!
Sign in to post a ripple.