Skip to main content
← Back to list
01Issue
BugShippedExtensions
Assigneesstack72

#374 files.get returns only minimal fields (id, name, kind, mimeType) because no 'fields' query parameter is sent

Opened by rndmcnlly · 5/19/2026· Shipped 5/19/2026

Summary

The get method on @swamp/gcp/drive/files advertises a state schema with 100+ properties (modifiedTime, createdTime, owners, webViewLink, capabilities, parents, size, etc.), but the actual data produced after a successful get contains only four fields: id, kind, mimeType, name.

This is because the Google Drive v3 API returns only a minimal set of fields by default. Clients must opt into additional fields via the fields query parameter — this is documented in Drive v3 best practices. fields=* returns everything; arbitrary projections are also possible.

The auto-generated GET_CONFIG in models/files.ts does declare the fields parameter as a valid query parameter, but there's no way for a model author or method caller to set it, and there is no sensible default applied by the model. The mismatch between the schema (which describes the full Drive resource) and the runtime data (a tiny stub) is confusing and undermines the value of get/sync for tracking file state.

Reproduction

  1. Pull @swamp/gcp/drive (latest version 2026.05.18.2).
  2. Create a files model:
    swamp model create @swamp/gcp/drive/files my-drive
  3. Set its global name and run get against a real fileId:
    swamp model method run my-drive get --input identifier=<some-fileId>
  4. Inspect the produced data:
    swamp data get my-drive <name> --json | jq '.content | keys'
    # → ["id", "kind", "mimeType", "name"]
  5. Compare against the schema, which declares many more fields — none of them are populated.

Workaround

None from the swamp side. A user can hit the API directly (e.g. gws drive files get --params '{"fileId": "...", "fields": "*"}') but at that point swamp's data caching is bypassed.

Suggested Fixes (any of these would help)

  1. Sensible default: Have the auto-generator emit fields=* for any get/list/sync Discovery operation that supports the fields query parameter. This trades a little extra response payload for a model that actually matches its schema. (Probably the right default — the auto-mirror is already "everything," not "opinionated subset.")

  2. Pass-through input: Allow methods to forward known query parameters (fields, includePermissionsForView, etc.) from method inputs through to the HTTP call, so callers can control projection per invocation.

  3. Document the limitation: At minimum, the README and the auto-generated method descriptions should warn that without one of the above, get/sync returns Drive's minimal projection rather than the model's declared shape.

This issue is likely not specific to Drive: any GCP API that uses the partial-response fields parameter (Gmail, Calendar, Sheets, Docs, Slides, Admin SDK, and many Cloud APIs) probably exhibits the same behavior. A fix in the generator would benefit the whole @swamp/gcp/* family.

Environment

  • swamp 20260516.045246.0-sha.e6eda98d
  • @swamp/gcp/drive 2026.05.18.2
  • Tested with both folder and Doc fileIds — both return the same four-field stub

Upstream repository: https://github.com/systeminit/swamp-extensions

Environment

  • Extension: @swamp/gcp/[email protected]
  • swamp: 20260516.045246.0-sha.e6eda98d
  • OS: darwin (aarch64)
  • Deno: 2.7.14+19bd3d8
  • Shell: /bin/zsh
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 4 MOREREVIEW+ 3 MOREPR_MERGEDCOMPLETE

Shipped

5/19/2026, 4:52:58 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/19/2026, 3:13:59 PM

Sign in to post a ripple.