Repository navigation
codegen: name POST /v3/videos/{video_id} edit - #456
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
terencechotai2-commits
left a comment
There was a problem hiding this comment.
Approving at 8f29ef8. The override is right, and I ran both examples end to end.
Examples, run against a build where the endpoint is visible. I took experiment-framework master's external-api.json, dropped x-cli-visible: false from editVideoV3, ran make generate and built the binary.
heygen video edit --helpshows<video-id>as positional,--idempotency-keyand--edit-versionas required flags,-d, and all three examples. No missing-examples warning for the endpoint.- I ran both examples against a local stub, with real ids in place of the placeholders and a UUID key:
- narration change →
POST /v3/videos/vid123,Idempotency-Keyset, body{"edit_version","scenes":[{"id","script":[{"id","type":"text","text"}]}]}; - scene delete → same path and header, body
{"edit_version","actions":[{"type":"delete_scene","scene_id"}]}.
- narration change →
- Both bodies match the API schema field for field:
EditVideoRequestrequires onlyedit_version, andscenes/actionsare independent.ScenePatchrequiresid; script entries not listed stay unchanged, so a one-line patch is valid.TextLinePatchrequiresid+type.DeleteSceneActionrequirestype+scene_id.- All of these are
additionalProperties: false, and neither example sends an extra key.
- A UUID matches the key pattern
^[A-Za-z0-9_\-:.]{1,255}$. edit_versionand the lineids are fields of the scenes read (VideoScenesResponse), so the "take them from 'video scenes get'" hint holds.- Leaving out
--idempotency-keyfails locally with a usage error (exit 2).
Codegen:
go test ./codegen/...passes.- Removing the override fails
TestGroupEndpoints_VideoEditDoesNotCollideWithCreate.
CI: govulncheck is red, and it isn't caused by this PR. It reports new net/http stdlib advisories (GO-2026-6610 … 6617) against go1.25.13, which this PR doesn't change. The last runs on main were 2026-10-08, before those advisories, so the next PR will hit the same failure until the toolchain is bumped. Everything else passes.
FYI, not caused by this PR: with -d and no edit_version in the JSON, the CLI sends the request even though --edit-version is listed as required. The API's 400 still catches it.
— tai2
jrusso1020
left a comment
There was a problem hiding this comment.
Approve at 8f29ef86. This adds to tai2's review, which ran the examples against a stub.
I checked the generated output against experiment-framework master's openapi/external-api.json, with and without this PR:
- Endpoint hidden (today):
gen/from this head and frommainis identical (diff -rclean). It changes nothing until the flip. - Endpoint visible (
x-cli-visible: true):mainfails:Add an entry to nameOverrides ... to disambiguate.- This head generates
video editwith the requiredidempotency-keyheader flag, and both examples end up in the help text. - The only missing-examples warnings are the two unrelated
/v3/models/imagesendpoints.
- Examples vs the spec:
EditVideoRequestrequires onlyedit_version.ScenePatchneedsid,TextLinePatchneedsid+type: "text", andDeleteSceneActionneedstype: "delete_scene"+scene_id. All of these areadditionalProperties: false, and both example bodies use exactly those keys.Idempotency-Keyis a required header (RequiredIdempotencyKey), so--idempotency-keyis right in both. - Test: removing the override makes
TestGroupEndpoints_VideoEditDoesNotCollideWithCreatefail.
Side note, not this PR: gen/ on main is already behind master's spec. Regenerating from it changes 7 files even with the edit endpoint hidden, so the next codegen sync PR will carry more than the flip.
Reuse: the existing nameOverrides mechanism, same shape as send / generate · Simpler: already minimal (one map entry, examples, one test).
— Rames
Description
Part of PRINFRA-1487
The API has an Edit Video endpoint,
POST /v3/videos/{video_id}. It edits an existing video's scenes and re-renders it under the samevideo_id. It's hidden from the CLI today (x-cli-visible: false). Codegen derivescreatefor every POST, so once the endpoint is visible it would collide withPOST /v3/videos, andmake generatewould fail withtwo endpoints map to "create".This adds a
nameOverridesentry naming itedit(heygen video edit <video-id>), following thesendandgenerateoverrides, plus examples for the command. Both have to land before the API makes the endpoint visible to the CLI. Otherwise the codegen sync PR that the flip triggers would fail on the collision.An override and examples for an endpoint the spec hides generate nothing, so this changes no command today.
Testing
make generateagainst experiment-framework master's spec:gen/is byte-identical with and without this change.createcollision. With it, codegen generatesvideo editwith a positionalvideo-id, the required--idempotency-keyheader flag and-d.STRICT=1no longer reports the endpoint as missing examples.TestGroupEndpoints_VideoEditDoesNotCollideWithCreate: both video POSTs visible givecreateandedit. Removing the override fails it.make testandmake lintpass.