Skip to content

chore: sync Rust client with Apify OpenAPI spec v2-2026-07-08T143931Z + compression/OS-token alignment - #16

Merged
Pijukatel merged 5 commits into
masterfrom
claude/eager-mayer-1w4ucz
Jul 10, 2026
Merged

chore: sync Rust client with Apify OpenAPI spec v2-2026-07-08T143931Z + compression/OS-token alignment#16
Pijukatel merged 5 commits into
masterfrom
claude/eager-mayer-1w4ucz

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Syncs the Rust client with Apify OpenAPI spec v2-2026-07-08T143931Z and aligns it with recent reference-client changes, then applies two cross-client uniformity requirements. Version 0.5.0.

Changes

Spec sync

  • Bumped API_SPEC_VERSION to v2-2026-07-08T143931Z. The incremental bump introduced no in-scope endpoint/parameter/schema change; coverage is unchanged.

Request-body compression — both brotli and gzip (reference: apify-client-js#962)

  • Added a public RequestCompression enum (Brotli default, Gzip) and ApifyClientBuilder::request_compression(...). Both paths are implemented, genuinely reachable via the selector, and tested (brotli via the brotli crate at quality 6; gzip via flate2 at level 6). Existing behavior preserved: only compress bodies ≥ 1024 bytes, compress once before the retry loop, skip when Content-Encoding is already set. The enum is #[non_exhaustive] for forward compatibility.

User-Agent OS token — identical across all clients (reference: apify-client-js#964)

  • The OS token now equals the reference JS client's os.platform() value for the running platform (darwin not macos, win32 not windows, sunos not solaris/illumos), via map_os_to_node_platform(std::env::consts::OS).

Docs

  • Documented request_compression/RequestCompression, the User-Agent/OS-token format, the Extra field type, KeyValueStore record/key types, and error types with import paths; fixed the README install version pin (0.40.5).

Testing

  • cargo fmt --check and cargo clippy --all-targets -- -D warnings clean.
  • Unit tests cover both compression paths (brotli + gzip round-trips, builder default) and the OS-token mapping against an independent Node-platform oracle.
  • Full integration suite, 8 example tests, and 29 doctests pass against the live API (APIFY_TOKEN present).

@Pijukatel Pijukatel changed the title chore: sync Rust client with Apify OpenAPI spec v2-2026-07-08T143931Z chore: sync Rust client with Apify OpenAPI spec v2-2026-07-08T143931Z + compression/OS-token alignment Jul 10, 2026
claude added 5 commits July 10, 2026 07:54
- Bump API_SPEC_VERSION to v2-2026-07-08T143931Z and crate version to 0.4.8
- Add brotli request-body compression (bodies >= 1024 bytes, Content-Encoding: br)
- Add regression test asserting the User-Agent OS token is a short lowercase platform identifier
- Documentation polish (resource-clients section, stream return types, reqwest note, paginate_requests example, public_base_url)
…with reference

- Add RequestCompression enum (Brotli default, Gzip) and
  ApifyClientBuilder::request_compression selector; both compression paths
  are reachable and tested.
- Map User-Agent OS token to Node os.platform() values (macos->darwin,
  windows->win32, solaris->sunos) for cross-client uniformity.
- Bump crate version to 0.5.0; update CHANGELOG and docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
- Add named GZIP_COMPRESSION_LEVEL constant (matches zlib default 6).
- Correct doc comments/enum docs to stop implying the reference exposes a
  selectable encoding; remove defensive noise.
- Docs: add RequestCompression to crate-root re-export list, runnable gzip
  example, HttpBackend import path, bump install version to 0.5.
- Inline node_platform_token into build_user_agent; OS-token test now uses an
  independent Node-platform oracle instead of the production mapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
… enum/test

- README.md: bump apify-client install pins from "0.4" to "0.5" (both the
  default and the rustls snippet) to match Cargo.toml 0.5.0; the old pins
  predate the RequestCompression feature added in 0.5.0.
- Add #[non_exhaustive] to the new public RequestCompression enum so future
  variants can be added without a breaking major bump.
- Rename default_request_compression_is_brotli ->
  builder_default_request_compression_is_brotli and assert the builder's
  default via the public builder path (no .request_compression() call) rather
  than the Default derive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
- src/common.rs: map Rust `illumos` -> Node `sunos` (both solaris and
  illumos collapse to sunos); fix doc/comment wording (four spellings differ,
  not three); drop redundant per-arm comments; add illumos test assertion.
- README.md: document request_compression/RequestCompression and the
  User-Agent format + OS-token mapping (new Request compression + User-Agent
  subsections).
- docs/README.md: extend models enumeration (KeyValueStore{Key,KeysPage,Record},
  Task, Schedule, Webhook, WebhookDispatch); document Extra alias with a
  compiling snippet; add ApifyClientError import note; note the OS-token
  mapping in the User-Agent paragraph.
- docs/{tasks,schedules,webhooks}.md: state the models live in
  apify_client::models with import lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
@Pijukatel
Pijukatel force-pushed the claude/eager-mayer-1w4ucz branch from 39a40db to 3a667d8 Compare July 10, 2026 07:54
@Pijukatel
Pijukatel merged commit 4afd4d7 into master Jul 10, 2026
2 checks passed
@Pijukatel
Pijukatel deleted the claude/eager-mayer-1w4ucz branch July 10, 2026 10:53
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