feat!: update Go client for Apify OpenAPI spec v2-2026-06-24T105326Z#6
Merged
Conversation
Update from spec v2-2026-06-23T113219Z to v2-2026-06-24T105326Z. A full operation- and parameter-level audit found no changes to the in-scope API surface (same 131 paths/231 operations/parameters/schemas), so the spec update itself is a version bump only. The new /v2/browser-info and /v2/tools/* operations remain out-of-scope (absent from the apify-client-js reference). Spec-compliance fix surfaced by the review pass (mirrors the Rust sibling): - BREAKING: ListRequestsOptions.Filter is now []string (serialized comma-joined via AddCSV), matching the spec (array of enum locked|pending) and the JS reference. Previously a single *string that could not express the multi-value union. Allowed values exported as RequestFilterLocked/RequestFilterPending. CLIENT_VERSION bumped 0.2.3 -> 0.3.0 (minor, per SemVer), consistent with the Rust sibling. - API_SPEC_VERSION bumped to v2-2026-06-24T105326Z; README and CHANGELOG updated. - Tests: add offline TestListRequestsFilterCommaJoined, extend the live request-queue lock-lifecycle test and the storages example/doc snippet to exercise a multi-value filter; update the validation test for the new signature. - Docs: document the Filter array type, ListRequests/UpdateRequest/ BatchDeleteRequests return types and batch-delete payload, and manual cursor pagination semantics. - .gitignore: ignore the extension-less example build binaries.
The requirements state the isAtHome flag is "based on the environment variable APIFY_IS_AT_HOME, False if env variable is missing", and the JS reference reads only APIFY_IS_AT_HOME. A prior iteration also honored a bare `isAtHome` environment variable; that accommodation was non-standard (present in neither the requirements nor the reference) and is removed, mirroring the Rust sibling. - client.go: collapse the two env-var constants to a single envIsAtHome = "APIFY_IS_AT_HOME"; defaultIsAtHome reads only that. - common.go: BuildUserAgent doc comment rewritten. Lowercase rendering unchanged. - Test renamed to TestDefaultIsAtHomeReadsOnlyApifyIsAtHome; asserts a bare `isAtHome` env var does NOT affect the flag. - README and CHANGELOG [0.3.0] updated; a forward-pointer is added to the superseded historical entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the Go client from Apify OpenAPI spec
v2-2026-06-23T113219Zto the latestv2-2026-06-24T105326Z.A full operation- and parameter-level audit of every in-scope operation against the new spec found no changes to the in-scope API surface (same 131 paths / 231 operations, identical parameters and request/response schemas) — the spec update itself is a version bump only. The new
/v2/browser-infoand/v2/tools/*operations remain out-of-scope (absent from theapify-client-jsreference). This PR also lands spec-compliance/correctness fixes surfaced by the review pass, mirroring the Rust sibling (apify-client-rust#7).Changes
Spec compliance (breaking)
ListRequestsOptions.Filter(forGET /v2/request-queues/{queueId}/requests) is now[]string, serialized comma-joined via the existingAddCSVhelper, matching the spec (array of the enum valueslocked/pending,style=form explode=false) and the JS reference (filter.join(',')). Previously a single*string, which could not express the multi-value union. Allowed values are exported asRequestFilterLocked/RequestFilterPendingwith per-entry validation. This is a spec-compliance bugfix and a breaking change to that field's type — hence the minor version bump0.2.3 → 0.3.0(consistent with the Rust sibling).Implementation correctness
User-AgentisAtHomeflag is now based solely on theAPIFY_IS_AT_HOMEenvironment variable, matching the requirement ("based on the environment variableAPIFY_IS_AT_HOME,Falseif env variable is missing") and the JS reference (which reads only that variable). The two env-var constants were collapsed to a singleenvIsAtHome = "APIFY_IS_AT_HOME"; a previously-honored bareisAtHomeenvironment variable — a non-standard accommodation present in neither the requirements nor the reference — is no longer consulted. Lowercasetrue/falserendering is unchanged. (Test updated to assert a bareisAtHomeis ignored.)Versioning
API_SPEC_VERSION→v2-2026-06-24T105326Z;CLIENT_VERSION→0.3.0.README.mdspec line andCHANGELOG.md[0.3.0]entry updated (with a forward-pointer on the superseded historicalisAtHomenote).Tests
TestListRequestsFilterCommaJoined(asserts a single comma-joinedfilter=locked,pending).examples/storagesprogram + adocs/storages.mdsnippet to exercise a multi-value filter.isAtHometest for the new behavior.Docs
Filterarray type, theListRequests/UpdateRequest/BatchDeleteRequestsreturn types and batch-delete payload shape, and manual cursor pagination semantics;READMEisAtHomesection now describes onlyAPIFY_IS_AT_HOME.Housekeeping
.gitignore: ignore the extension-less example build binaries.Verification
gofmt -l .,go vet ./...,golangci-lint run,go build ./...— clean.go test .(unit) — pass.go test ./tests/ -p 1 -parallel 4 -skip '^(TestExample|TestDocSnippets)') and theTest examplesstep (-run '^(TestExample|TestDocSnippets)') ran green against the live API.