Repository navigation
Conversation
varadekd
force-pushed
the
feat/typed-robots-openapi
branch
from
October 4, 2026 15:24
f1a8345 to
3b23d33
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.
Problem
This SDK drifts from the Transloadit API in a few concrete, verifiable ways: AssemblyInfo is missing roughly 50 fields present in the current Assembly Status schema (region, instance, websocket_url, update_stream_url, account/notify/tus-upload details, per-job error diagnostics), three of its fields (ClientAgent, ClientIp, ClientReferer) have no json tag and have therefore never populated from API responses, there's no support for the OAuth2 bearer-token flow (POST /token), and there's no typed representation of the Assembly Notification webhook payload — users currently parse and verify it by hand.
Approach
Each gap is fixed by diffing the hand-written types against the public OpenAPI spec (https://api2.transloadit.com/openapi.json) field-by-field, rather than guessing. A contract_test.go fetches that spec and asserts the /token and webhook schemas match what these types assume, so future drift fails CI instead of surfacing as a silent gap again.
We evaluated generating these types with oapi-codegen or a custom generator, but the two schemas these fixes touch are small (under 10 required fields combined) and not shaped like the other ~290 schemas in the spec (which are content-hash-named and not meant for direct codegen). A generator would be more code than it generates here, so these are hand-written, with the contract test providing the drift-detection a generator pipeline would otherwise give.
Backward compatibility
Fully additive. No existing field, method, or behavior changes shape. AssemblyInfo's new fields are appended; existing ones are untouched. AssemblyNotificationPayload and BearerToken/BearerTokenRequest are new types; IssueBearerToken and ParseAssemblyNotification are new functions. AddStep's map[string]interface{} signature is unchanged.
How to review
Test evidence
gofmt, go vet, and the full test suite pass. The 11 pre-existing tests that need real TRANSLOADIT_KEY/TRANSLOADIT_SECRET are unaffected (verified identical failure set against unmodified main when run without credentials).
Spec issues found (worth reporting to Transloadit)
Follow-ups (explicitly out of scope here)