Skip to content

fix(sdks): use JSONPath filter expressions in overlay + simplify Go SDK union types - #744

Merged
alexluong merged 2 commits into
mainfrom
fix/pagination-overlay-filter-expressions
Mar 13, 2026
Merged

fix(sdks): use JSONPath filter expressions in overlay + simplify Go SDK union types#744
alexluong merged 2 commits into
mainfrom
fix/pagination-overlay-filter-expressions

Conversation

@alexluong

@alexluong alexluong commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

1. JSONPath filter expressions in pagination overlay

Replace brittle positional parameter indices with name-based filter expressions (e.g., parameters[?@.name == 'dir'] instead of parameters[2]). The indices broke when #732 added new query params which shifted all parameter positions.

Before (broken): direction override applied to next, next_cursor applied to time[gt], etc.
After (fixed): all overrides target the correct params by name, immune to reordering.

2. Go SDK: replace oneOf unions with plain arrays

Add a Go-specific Speakeasy overlay (go-array-params-overlay.yaml) that converts all oneOf: [string, array] query params to plain array types. This eliminates verbose tagged union constructors in the generated Go SDK. Affects 16 params across 8 endpoints.

A new Outpost API (Go) source is added to .speakeasy/workflow.yaml so the overlay only applies to Go — TS and Python are unaffected.

// Before — tagged union constructors
res, err := s.Events.List(ctx, operations.ListEventsRequest{
    TenantID: operations.CreateListEventsTenantIDArrayOfStr(
        []string{"tenant_123", "tenant_456"},
    ).Pointer(),
    Topic: operations.CreateListEventsTopicArrayOfStr(
        []string{"user.created", "user.updated"},
    ).Pointer(),
})

// After — plain slices
res, err := s.Events.List(ctx, operations.ListEventsRequest{
    TenantID: []string{"tenant_123", "tenant_456"},
    Topic:    []string{"user.created", "user.updated"},
})

Test plan

  • speakeasy overlay validate passes for both overlays
  • speakeasy overlay apply confirms oneOf removed, correct param targeting
  • speakeasy run -t outpost-go — compiles, lints, tests pass
  • TS/Python sources unchanged — no DX regression

🤖 Generated with Claude Code

Replace brittle positional parameter indices with name-based filter
expressions (e.g., `parameters[?@.name == 'dir']` instead of
`parameters[2]`). The indices broke when #732 added new query params,
causing overrides to misapply (e.g., `direction` applied to `next`
instead of `dir`).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Mar 11, 2026 5:43pm
outpost-website Ready Ready Preview, Comment Mar 11, 2026 5:43pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – outpost-docs March 11, 2026 12:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – outpost-website March 11, 2026 12:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – outpost-docs March 11, 2026 17:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – outpost-website March 11, 2026 17:39 Inactive
Add Go-specific Speakeasy overlay that converts all oneOf [string, array]
query params to plain array types, eliminating verbose tagged union
constructors in the generated Go SDK. Affects 16 params across 8 endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexluong
alexluong force-pushed the fix/pagination-overlay-filter-expressions branch from e72a0ef to af73cc4 Compare March 11, 2026 17:43
@vercel
vercel Bot temporarily deployed to Preview – outpost-website March 11, 2026 17:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – outpost-docs March 11, 2026 17:43 Inactive
@alexluong alexluong changed the title fix(sdks): use JSONPath filter expressions in pagination overlay fix(sdks): use JSONPath filter expressions in overlay + simplify Go SDK union types Mar 11, 2026
Comment thread .speakeasy/workflow.yaml
@alexluong
alexluong merged commit 59fb3b4 into main Mar 13, 2026
9 checks passed
@alexluong
alexluong deleted the fix/pagination-overlay-filter-expressions branch March 13, 2026 04:34
alexluong added a commit that referenced this pull request Mar 13, 2026
The pagination cursor config (x-speakeasy-pagination) was bundled in the
Python pagination fixes overlay, which is only applied to the Python SDK
source. This meant Go and TS SDKs lost auto-pagination support after
#744 split the sources.

Extract the pagination config into a shared overlay applied to all three
sources, keeping only the Python builtin name overrides (dir, next, prev)
in the Python-specific overlay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants