Add schema directive to template manifests #3180
Open
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.
As of Spin 3.3 we include a
spin.toml
JSON schema as part of each release. This PR proposes linking that schema from template manifests: this provides (a measure of) validation and code completion out of the box (well, if the user has Even Better TOML or its equivalent installed).In this PR, I link to the manifest via a versioned release URL. We get this for free, but it does mean we need to update the templates whenever we update the schema doc (or on every release, if we want to avoid folks going "I'm on Spin 3.5, why did you give me this OLD schema"), and that users need to rev the link to get schema updates. If we wanted to invest a little more in the plumbing, we could upload schemas to a version-neutral location so users could automatically inherit improvements (or could still lock to a version via a GH URL). Thoughts?