-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add JSON schema for Development Container Template Metadata #350
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thankful, please advise |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Development Container Template Metadata", | ||
"description": "Development Container Template Metadata (devcontainer-template.json). See https://containers.dev/implementors/templates/ for more information.", | ||
"definitions": { | ||
"Template": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"$schema": { | ||
chrmarti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"description": "The JSON schema of the `devcontainer-template.json` file.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"description": { | ||
"description": "Description of the Template.", | ||
"type": "string" | ||
}, | ||
"documentationURL": { | ||
"description": "Url that points to the documentation of the Template.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"id": { | ||
"description": "ID of the Template. The id should be unique in the context of the repository/published package where the Template exists and must match the name of the directory where the devcontainer-template.json resides.", | ||
"type": "string" | ||
}, | ||
"keywords": { | ||
"description": "List of strings relevant to a user that would search for this Template.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"licenseURL": { | ||
"description": "Url that points to the license of the Template.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"name": { | ||
"description": "Name of the Template.", | ||
"type": "string" | ||
}, | ||
"options": { | ||
"description": "A map of options that the supporting tools should use to populate different configuration options for the Template.", | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/Option" | ||
} | ||
}, | ||
"platforms": { | ||
"description": "Languages and platforms supported by the Template.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"publisher": { | ||
"description": "Name of the publisher/maintainer of the Template.", | ||
"type": "string" | ||
}, | ||
"version": { | ||
"description": "The semantic version of the Template.", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is name required? It might be, but we don't have it written down it seems. It is optional for features. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. It isn't marked as required in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joshspicer Should we make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the tooling That said, we should probably just make it required since it's useful as a display name in our tooling and it's provided by default in our One thing to note - if we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems safer to update the spec to make it optional then. We could break existing features as you point out. One advantage of not making it required is that it is easier to write one-off features for prototyping or testing. We would still want features going into the index to have good names for the UI. 🤷♂️ |
||
"version" | ||
] | ||
}, | ||
"Option": { | ||
"description": "An option that the supporting tools should use to populate different configuration options for the Template.", | ||
"type": "object", | ||
"properties": { | ||
"default": { | ||
"description": "Default value for the option.", | ||
"type": [ | ||
"boolean", | ||
"string" | ||
] | ||
}, | ||
"description": { | ||
"description": "Description for the option.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "Type of the option. Valid types are currently: boolean, string", | ||
"type": "string", | ||
"enum": [ | ||
"boolean", | ||
"string" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"default", | ||
"description", | ||
"type" | ||
], | ||
"oneOf": [ | ||
chrmarti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"default": { | ||
"type": "boolean" | ||
}, | ||
"description": true, | ||
"type": { | ||
"type": "string", | ||
"const": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"default", | ||
"type" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"default": { | ||
"type": "string" | ||
}, | ||
"description": true, | ||
"enum": true, | ||
"proposals": true, | ||
"type": { | ||
"type": "string", | ||
"const": "string" | ||
} | ||
}, | ||
"required": [ | ||
"default", | ||
"type" | ||
], | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"enum": { | ||
"description": "A strict list of allowed string values. Free-form values are not allowed. Omit when using optionId.proposals.", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"enum" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"proposals": { | ||
"description": "A list of suggested string values. Free-form values are allowed. Omit when using optionId.enum.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/Template" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.