Skip to content

Add schema directive to template manifests #3180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

itowlson
Copy link
Collaborator

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).

image

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?

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@lann
Copy link
Collaborator

lann commented Jun 30, 2025

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?

I'm in favor of this. Three options come to mind:

  • Github Page from this repo, e.g. spinframework.github.io/spinframework/schemas/...; probably the easiest to get started with since it can be built in this repo
  • New subdomain e.g. schemas.spinframework.dev/... which could be hosted by Github Pages pretty easily; would probably make the most sense as a new e.g. spin-schemas repo; technically could be in this repo but that would be a little weird since you can only host one site per repo and schemas would "use up" that slot (though this could be migrated later)
  • Existing docs site, e.g. spinframework.dev/schemas/...; would require some integration with https://github.com/spinframework/spin-docs

@lann
Copy link
Collaborator

lann commented Jun 30, 2025

After editing the comment above several times I have developed An Opinion:

Let's create a subdomain like schemas.spinframework.dev pointing at Github Pages built from a branch in this repo. If we ever really want to use this repo's Page for something else we can migrate the schemas somewhere else such as Github Pages in another repo by redirecting the subdomain.

@lann
Copy link
Collaborator

lann commented Jun 30, 2025

^ I'm going to get started on this just because there is some lead time on the DNS update; we can always bail out if we don't like this approach.

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.

2 participants