Skip to content

Add schema directive to empty template - #3717

Merged
itowlson merged 1 commit into
spinframework:mainfrom
itowlson:empty-template-schema-directive
Sep 15, 2026
Merged

itowlson merged 1 commit into
spinframework:mainfrom
itowlson:empty-template-schema-directive

Conversation

@itowlson

Copy link
Copy Markdown
Contributor

Fixes #3699.

The current AppManifest serialisation type requires that there be at least one trigger. This makes the empty manifest invalid under the current schema.

I've proposed to fix this by allowing an empty set of triggers at the serialisation level, but validating during load. This changes the error output when you spin up an app with no triggers:

# Before

$ spin up
Error: TOML parse error at line 1, column 1
  |
1 | spin_manifest_version = 2
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
missing field `trigger`

# After

$ spin up
Error: Failed to load application

Caused by:
   0: Failed to load manifest from "spin.toml"
   1: Failed to load Spin app from "spin.toml"
   2: The application must have at least one trigger

The alternative is to keep the existing requirement and accept that there will be red squigglies in a new empty app. However, like the "before" error, the message will be correct but it will point to the wrong place, so I have pretty mixed feelings about this.

Note that we will want to publish a new schema directive before tagging this template - at the moment we merge it, the directive will continue to point to the "trigger required" schema, which fails. But as noted, the failure at least comes with a good error message, so eh.

@itowlson

Copy link
Copy Markdown
Contributor Author

Pleasingly, this also fixes #3698 does the bug smiting dance

@itowlson itowlson linked an issue Sep 15, 2026 that may be closed by this pull request
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
itowlson force-pushed the empty-template-schema-directive branch from 358f218 to 858d196 Compare September 15, 2026 21:08
@itowlson
itowlson merged commit d89963f into spinframework:main Sep 15, 2026
17 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.

http-empty template doesn't have manifest schema spin add to an empty manifest prints target env warning

2 participants