Generated Java SDK contract markers#101
Draft
kvz wants to merge 15 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
=============================================
- Coverage 77.04% 65.06% -11.98%
Complexity 217 217
=============================================
Files 13 14 +1
Lines 793 939 +146
Branches 71 85 +14
=============================================
Hits 611 611
- Misses 146 292 +146
Partials 36 36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
resumeTusUpload() is generated from the API2 resumeUpload TUS protocol contract: it discovers the server offset with a HEAD request, PATCHes the remaining bytes from that offset, asserts the final offset matches the content length, and waits for the Assembly to finish. The new api2-devdock-tus-resume-upload example interrupts an upload after the first chunk like a dropped connection would, then resumes it through the public SDK method. The lifecycle example now polls the Assembly list briefly because the API acknowledges creation before the list storage row lands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
API2 now has a Java Transloadit SDK adapter that can mechanically render Java SDK endpoint methods from contract metadata. This companion PR gives that generator real marker regions to rewrite and compare, plus checked-in consumer examples that prove the generated endpoint surface against devdock.
Experimental Status
Experimental work: this PR is part of the API2 contract/generated SDK effort and is intentionally kept as a Draft while the generated surface and consumer proof examples are validated.
What changed
createTusAssemblyinput from genericscenario.preparations[]instead of the removed API2 compatibility field.Transloadit.createTusAssembly(fileCount), which builds the contract-owned TUS Assembly request and delegates to the generatedcreateAssembly(options, extraData)endpoint method.Transloadit.getAssemblyByUrl(url)and a generatedTransloadit.waitForAssembly(assemblyUrl)polling feature.createTusAssembly,getAssemblyByUrl,listAssemblies, andcancelAssemblytogether against API2 devdock using contract-injected scenario JSON.examplesGradle project and added:examples:api2DevdockTemplateLifecycle,:examples:api2DevdockTusAssembly, and:examples:api2DevdockAssemblyLifecycle.Validation
node api2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform java --sdk-root ../java-sdk --compare-existingnode api2/bin/cli.ts contracts sdks qa --no-motd --dry-run --target transloadit --platform java --proof-level git-handwritten-examples./gradlew -q :examples:compileJava./gradlew checkcore/bin/devdock.ts exec tstrun system/sdk_examples/java-transloadit-examples.test.ts -vv --max-time-per-test 600Companion PRs
Transloadit
TUS
Allowed outward links from Transloadit to the related tus companion PRs: