Skip to content

Vanguard: Allow jobs that render a template URL - #3

Merged
zpl-zak merged 1 commit into
mainfrom
vanguard/template-src
Oct 30, 2026
Merged

zpl-zak merged 1 commit into
mainfrom
vanguard/template-src

Conversation

@zpl-zak

@zpl-zak zpl-zak commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The API can render either an uploaded template (template.id) or a template at a URL (template.src plus template.name). The CLI only allowed the first: validate.JobPayload required template.id, and the vendored spec marked id as required.

  • Spec: the JobTemplate schema is synced from nexrender/nexrender-api#186. id is optional and name is documented. internal/api/api.gen.go is regenerated with the pinned generator; JobTemplate.Id is now *string, and Name is a typed field.
  • Validation: exactly one of template.id or template.src. With src, template.name is required: the .aep/.mogrt file name, or the .aep path inside a .zip. These match the API's own 400s (MISSING_TEMPLATE_ID, TEMPLATE_SRC_ID_CONFLICT, missing name), but are caught locally, including under --dry-run.
template Before After
{ id } ok ok
{ src, name } template.id is required ok
{ id, src } sent, API 400 rejected locally
{ src } without name template.id is required template.name is required with template.src

This repository only has main, so the PR targets it. It should merge after the API spec PR, nexrender/nexrender-api#186, but it doesn't depend on that PR at runtime because the API already accepts src.

Found by Vanguard, the new end-to-end suite.

Testing

  • go generate ./internal/api, gofmt -l (clean), go vet ./..., go test ./..., go build ./cmd/nexrender.
  • New table test: an uploaded template and a template URL are accepted. Neither, both, and src without name are rejected. It uses the public example template https://nx1-assets-eu.nexrender.com/example/Test%20AEP.zip.

The API renders either an uploaded template (template.id) or a template
URL (template.src, with template.name), but the vendored spec marked id
as required and the CLI refused any job without it.

The JobTemplate schema is synced from nexrender-api (id optional, name
documented) and the generated client regenerated. Validation now asks
for exactly one of template.id or template.src, and for template.name
with template.src.

Found by Vanguard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zpl-zak
zpl-zak merged commit 764c9bf into main Oct 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant