Generated Java SDK contract markers#101
Draft
kvz wants to merge 9 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
============================================
- Coverage 77.04% 68.65% -8.40%
Complexity 217 217
============================================
Files 13 14 +1
Lines 793 890 +97
Branches 71 80 +9
============================================
Hits 611 611
- Misses 146 243 +97
Partials 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
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 is validated.
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.
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.examples/src/main/java/com/transloadit/examples/Api2DevdockTemplateLifecycle.java, a hand-written Java example that reads API2's injectedtransloaditTemplateLifecyclescenario JSON, runs create/get/list/update/delete, and writes observed result JSON for API2 to assert.examples/src/main/java/com/transloadit/examples/Api2DevdockTusAssembly.java, a hand-written Java example that calls generated high-levelcreateTusAssembly(fileCount), uploads contract-owned fixture bytes throughtus-java-clientto the returnedtus_url, then calls generatedwaitForAssembly(assemblyUrl).examplesGradle project and added:examples:api2DevdockTemplateLifecycleand:examples:api2DevdockTusAssembly.Companion PRs
Validation
api2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform java --sdk-root ../java-sdk --compare-existingapi2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform java --feature-id createTusAssembly --sdk-root ../java-sdk --rewrite-sdk --compare-existingapi2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform java --sdk-root ../java-sdk --rewrite-sdk --compare-existing(13 comparisons)api2/bin/cli.ts contracts sdks qa --no-motd --target transloadit --platform java --dry-run./gradlew -q :examples:classes./gradlew testcore/bin/devdock.ts exec tstrun system/sdk_examples/java-transloadit-examples.test.ts -vv --max-time-per-test 600