READMEs: fix every sample that misstates the API
Six commits, one per SDK. Every defect below was proven against the real SDK before editing, and every corrected snippet was re-proven green. Nothing here touches behavior — READMEs plus five doc comments in Kotlin/Swift source that showed the same phantom signatures.
Ruby — todos.create takes todolist_id:, not project_id:
The Quick Start's documented call fails at argument binding, before any HTTP:
ArgumentError: unknown keyword: :project_id
The corrected call (with http_post stubbed on the service singleton) POSTs /todolists/67890/todos.json.
Go — five fences didn't compile
Each reproduced offline as the exact compiler error (scratch module + replace directive, GOPROXY=off); all corrected snippets go build + go vet clean:
cannot range over projects (variable of type *basecamp.ProjectListResult) [both Quick Start programs]
not enough arguments in call to account.Campfires().List
have (context.Context)
want (context.Context, *basecamp.CampfireListOptions)
not enough arguments in call to account.Campfires().ListLines
have (context.Context, int64)
want (context.Context, int64, *basecamp.CampfireLineListOptions)
not enough arguments in call to account.Webhooks().List
have (context.Context, int64)
want (context.Context, int64, *basecamp.WebhookListOptions)
no new variables on left side of := [OTel fence redeclares hooks]
undefined: prometheus [chain-hooks fence]
Also "Requires Go 1.25 or later" → 1.26, matching go.mod. The README's fragment conventions (undeclared ctx, use(), top-level return err) are established style and stay.
Kotlin — error-handling sample didn't compile; tables lied
todos.get(projectId = 123, todoId = 456)— the generated signature isget(todoId: Long)(generated/services/todos.kt).- The
whenover sealedBasecampExceptioncovered 9 of 11 subclasses; a non-exhaustivewhenstatement over a sealed subject is a compile error, and the SDK's ownErrorTest.ktpins all 11 branches ("This ensures all branches compile (exhaustive when)"). AddedDiscoverySelection/DeviceFlowbranches and their Error Types rows. - Configuration Options documented
maxRetries/baseRetryDelay, butBasecampClientBuilderhas no setter for either and the client constructor isinternal— marked as fixed defaults. consoleHookssample output showedProjects.List; the generatedOperationInfoemitsProjects.ListProjects.- Same phantom
todos.getinBasecampException/BasecampClientdoc comments.
Swift — phantom arity plus an API that needs macOS 13
todos.get(projectId: 123, todoId: 456)— the generated signature isget(todoId: Int).- The same fence used
Task.sleep(for: .seconds(...))whilePackage.swiftdeclares.macOS(.v12). Proven under a macOS 12 target:
error: 'sleep(for:tolerance:clock:)' is only available in macOS 13.0 or newer
Replaced with the nanoseconds form the SDK's own retry path uses (green under the same target). Also fixed the phantom signatures in BasecampError/AccountClient/Pagination doc comments.
TypeScript — list() auto-paginates; the docs claimed the opposite
"List methods return a single page of results by default" inverts reality. Behavioral proof against a stubbed fetch serving two pages:
HTTP calls: 2; items returned: 3; meta.totalCount: 3; Array.isArray: true
maxItems:2 -> items: 2; truncated: true
The Pagination section now leads with auto-pagination and ListResult/.meta, shows maxItems, and reframes fetchAllPages/paginateAll as the escape hatch for raw client.GET calls. The helper callbacks read (r) => r.json() as Promise<any[]> because bare r.json() is Promise<unknown> under the repo's strict/NodeNext config and fails tsc --noEmit; all three replacement blocks typecheck clean under that config.
All six SDKs — "45 services" → 46
Stale since EverythingService landed. Verified per SDK: 46 Kotlin accessors, 46 Swift accessors, 46 Ruby service classes (47 files minus base_service.rb), 46 Python service modules (excluding _base/_async_base), matching SPEC.md's counts.
Deliberately not touched
- Install sections stay version-less (#495).
- Root README — all six quick starts verified correct.
python/README.mdRetry Behavior — current #502 text.ruby/README.mdRetry Behavior — defective but deserves the #502-style whole-section treatment; issue to follow.- Kotlin "2.0+" floor — repeated verbatim in CONTRIBUTING.md, so changing it is a policy call, not a doc fix.
Summary by cubic
Fix incorrect README code samples and doc comments across all SDKs to match real API signatures, pagination behavior, and compile-time constraints. No runtime changes; updates service count references to 46.
- Bug Fixes
- Ruby:
todos.createusestodolist_id, notproject_id. - Go: All snippets compile; iterate
result.Projects, passnilto Campfires/Webhooks list calls, fix OTel hooks reassignment (construct client after), addprometheusimport; "Requires Go 1.26". - Kotlin: Use
todos.get(todoId), makeBasecampExceptionsample exhaustive withDiscoverySelection/DeviceFlow; markmaxRetries/baseRetryDelayas fixed defaults; console hooks showProjects.ListProjects; fix doc comments. - Swift: Use
todos.get(todoId), replaceTask.sleep(for:)withnanosecondsfor macOS 12; fix doc comments and the pagination example. - TypeScript:
list()auto-paginates and returns aListResultwith.meta.totalCountand.truncated; showmaxItems; update raw pagination examples usingfetchAllPages/paginateAllfrom@37signals/basecampwith typedr.json(). - All SDKs: "45 services" → 46 to reflect
EverythingService.
- Ruby: