-
Notifications
You must be signed in to change notification settings - Fork 228
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
Publish devcontainer.json schema #14
Publish devcontainer.json schema #14
Comments
Is this referring to the JSON Schema doc in https://github.com/microsoft/vscode/tree/main/extensions/configuration-editing/schemas? Perhaps related to #1, it would be handy if that schema didn't include VS Code references that schema from being used to strictly verify a devcontainer.json file. There are also properties like |
@greggroth Yeah the devcontainer.json file is "json5 / jsonc / json with comments" which is an extension of the base json format. I'm not aware of an official way to denote that in a json schema. That particular copy is the one used in production by VS Code and Codespaces today, which also predates the refactoring being discussed here. The ref is for a property that would move with #1 (specifically, that's VS Code settings which has a schema of its own). I do think it would be reasonable, however to allow people to submit PRs to the spec's copy of the schema that would be located here that would include refs to an externally defined tool/service specific schema not maintained in this repository. e.g. @chrmarti was this how you were thinking about getting the schema in shape for the spec? We can also house both a common schema description and a separate page with tool/service specific properties. Here again, any tool/service would be welcome to contribute to that. Right now the only reference we have includes VS Code properties and descriptions and includes references to VS Code specific instructions. This PR has some content to try to alleviate that for a reference that would be included here. |
Correct. @aeschli Could you advise if this makes sense: We would like to publish the devcontainer.json schema at schemastore.org (like TypeScript for tsconfig.json does) and have it reference other tools-specific parts using |
The problem of the $ref would be that the base schema would have to know all possible extensions. That's not very practical. In VS Code we allow that a file or file extension can be associated with multiple schemas. These are independent schemas each describing a seperate part of the JSON structure. The schmeas are not referencing each other. The schema service in the editor combines all of these with 'allOf'. |
Makes sense. One disadvantage might be that other editors will not offer IntelliSense for the VS Code and Codespaces parts, but that might be fine. |
I suggest the following structure for the schema:
{
"name": "Dev Container configuration file",
"description": "The devcontainer.json file contains any needed metadata and settings required to configurate a development container for a given well-defined tool and runtime stack",
"fileMatch": ["devcontainer.json", ".devcontainer.json"],
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json"
}
I imagine the policy to accept a new $ref would be:
|
Assigning to myself to update our documentation (containers.dev). |
Currently hosted in the VS Code repo, the source should move to the reference implementation when that becomes available.
Similarly to the tsconfig.json schema, we could submit a PR to https://github.com/SchemaStore/schemastore to make it available at schemastore.org.
The text was updated successfully, but these errors were encountered: