Skip to content

fix(Query): omit a JSON object member from the canonical query (#536) - #562

Merged
thomasfosterau merged 1 commit into
trunkfrom
issue-536-no-base-to-string
Nov 7, 2026
Merged

thomasfosterau merged 1 commit into
trunkfrom
issue-536-no-base-to-string

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Part of #536, the typescript/no-base-to-string row. The issue stays open for its other rules.

pairsOf in src/internal/canonical.ts wrote a flat query member whose encoded value is a JSON object as key=[object Object]. The issue asked for a behaviour to be chosen ("omit, like null, or fail"). This takes omit:

  • A JSON object has no flat wire form, and orderPairs already omits the other member without one (null).
  • Failing would make Query.canonical, and so every self and pagination link built from it, throw on a consumer's flat schema, inside link building, where no caller handles it.

number and boolean members are now stringified explicitly. Arrays are unchanged (repeated key, or include's comma form). The doc comments of orderPairs and Query.canonicalPairs say so.

With its only site gone, the "typescript/no-base-to-string": "warn" line leaves vite.config.ts, so the rule is back at the suspicious category's error.

Verification

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass. no-base-to-string reports 0 sites, now at error.
  • vp run check: pass
  • vp run -r test:unit: pass, including the new "omits a JSON object member" case in src/Query.test.ts
  • vp run docgen: pass
  • vp run test:coverage, then fallow audit --base origin/trunk: pass (1 inherited finding excluded)

pnpm audit --audit-level high was not run here. CI runs it.

Changeset

  • .changeset/canonical-omits-json-object.md, patch, as the issue says.

Notes

No signature change.


Generated by Claude Code

`pairsOf` wrote a JSON object member as `key=[object Object]`; it has no
flat wire form, so it is omitted like `null`. With its one site gone,
`typescript/no-base-to-string` is back at `error`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMx5cf5KQSi9sQ4tu1
@thomasfosterau
thomasfosterau merged commit afd17e7 into trunk Nov 7, 2026
3 checks passed
@thomasfosterau
thomasfosterau deleted the issue-536-no-base-to-string branch November 7, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants