chore: sync Java client with Apify OpenAPI spec v2-2026-07-08T143931Z + compression/OS-token alignment#5
Merged
Conversation
9ca2b65 to
0aa349f
Compare
- Bump API_SPEC_VERSION to v2-2026-07-08T143931Z and client version to 0.1.2 - Align User-Agent OS token with reference clients via platformToken mapping (os.name/java.vm.name -> linux/darwin/win32/android short identifiers) - Add gzip request-body compression for bodies >= 1024 bytes (Content-Encoding: gzip) - Add CompressionTest and platform-token mapping tests
…iform OS token - Add brotli request-body compression (Content-Encoding: br) via brotli4j, preferred over gzip; gzip (Content-Encoding: gzip) remains the fallback when no brotli native codec is bundled for the platform. Keeps the 1024-byte threshold, compress-once-before-retries, and skip-when-Content-Encoding-set behavior. Matches the reference JS client's maybeCompressValue. - Add brotli4j 1.23.0 core dependency plus per-platform native codecs (linux/osx x86_64+aarch64, windows x86_64) at runtime scope in pom.xml. - Extend User-Agent OS-token test to assert the emitted token exactly matches the reference JS os.platform() value for sunos, freebsd, openbsd, aix in addition to linux/darwin/win32/android. - Bump client version 0.1.2 -> 0.1.3 and add CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
- Update Maven, Gradle, and Version.CLIENT_VERSION references from 0.1.2 to 0.1.3 to match pom.xml, Version.java, and CHANGELOG [0.1.3]. - Replace the non-expanding jackson-*.jar classpath glob with a lib/ directory populated via mvn dependency:copy-dependencies and the JVM-native lib/* wildcard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xbC2QoA4QKyvhC1d7gYap
0aa349f to
15ccd7b
Compare
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
Syncs the Java client with Apify OpenAPI spec
v2-2026-07-08T143931Zand aligns it with recent reference-client changes, then applies two cross-client uniformity requirements. Version0.1.3.Changes
Spec sync
Version.API_SPEC_VERSIONtov2-2026-07-08T143931Z. No in-scope endpoint/parameter/schema delta; coverage unchanged.Request-body compression — both brotli and gzip (reference: apify-client-js#962)
HttpClientCorenow prefers brotli (Content-Encoding: br) viacom.aayushatharva.brotli4jand falls back to gzip (Content-Encoding: gzip) when the brotli native library is unavailable.pom.xmladdsbrotli4j(compile) plus per-platform native codecs (linux/macOS x86_64+aarch64, windows x86_64) at runtime scope; the native lib loads and is exercised on Linux CI.compress(byte[], boolean)is a pure function so both codings are directly unit-tested; native-only brotli tests are gated withassumeTrueto skip (not error) on platforms without the native lib. Existing behavior preserved: only compress bodies ≥ 1024 bytes, compress once before the retry loop, skip whenContent-Encodingis already set.User-Agent OS token — identical across all clients (reference: apify-client-js#964)
platformTokenemits exactly the reference JSos.platform()tokens; the mapping test now assertssunos(SunOS + Solaris),freebsd,openbsd,aixin addition tolinux/darwin/win32/android(darwin checked before win to avoid theDarwin→win32trap).Docs
CLIENT_VERSIONmention (0.1.2→0.1.3) and the quick-start classpath instructions.Testing
mvn spotless:checkandmvn spotbugs:checkclean.mvn test: 108 tests, 0 failures — integration tests confirm the live API accepts the brotli-encoded uploads.