spec
spec copied to clipboard
Add JSON schema for Development Container Template Metadata
I've made an attempt at creating the JSON schema for Template metadata which I requested in #349.
Some notes:
- It is patterned after
devContainerFeature.schema.json
, on the theory that Template metadata has more in common with Feature metadata than it does Development Container metadata. - The spec doesn't indicate which properties are required, so:
- For Templates, between how they are described to be used and the fact that
id
,name
, andversion
are required for Feature metadata, I've assumed those same three properties are required for Template metadata. - For options, based on how they are described to be used, I've assumed that all properties are required (with the exception of
enum
andproposals
; see the points below).
- For Templates, between how they are described to be used and the fact that
- Though the spec indicates that an option's
default
property may only be a string, I've assumed that it should instead be a boolean when thetype
property is"boolean"
. - With regards to the
enum
andproposals
properties of options:- I've assumed that neither
enum
norproposals
are relevant to boolean options, so have forbidden them. - I've assumed that
enum
cannot be an empty array, on the theory that because free-form values are not allowed, it would make it impossible to set a valid value for that option.- I have not made the same assumption regarding
proposals
, as free-form values are allowed.
- I have not made the same assumption regarding
- I've assumed that neither
- I haven't placed any restrictions (e.g. via patterns) on Template IDs, Template versions, or option IDs, as the Feature schema also doesn't. However, these could easily be added.
Apologies for the verbose description; I'm only getting started with Development Containers and want to make sure that any mistakes I've made are easy to spot. 😅
@microsoft-github-policy-service agree
El jue., 21 de diciembre de 2023 1:47 p. m., Ben Blank < @.***> escribió:
@.**** commented on this pull request.
In schemas/devContainerTemplate.schema.json https://github.com/devcontainers/spec/pull/350#discussion_r1434441959:
@@ -0,0 +1,182 @@ +{
- "$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": {
I just pushed a new commit to the PR which adds this.
— Reply to this email directly, view it on GitHub https://github.com/devcontainers/spec/pull/350#discussion_r1434441959, or unsubscribe https://github.com/notifications/unsubscribe-auth/A65ALOP2JMICH4CDYRD6QGDYKSG6NAVCNFSM6AAAAABAUKUTBCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJTGU3TAOBWGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm going to be honest I am researching who or what and why I am getting repositories i don't have any idea how and im experiencing lotsbof abnormal iterference on my and. Droid devices so I have no clue I need assistance or help to identify why my devices have like gecko HTML
On Tue, Jan 30, 2024, 9:29 AM Josh Spicer @.***> wrote:
@.**** commented on this pull request.
In schemas/devContainerTemplate.schema.json https://github.com/devcontainers/spec/pull/350#discussion_r1471558716:
"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",
In the tooling name is not required. For example when we build the READMEs in devcontainers/action it will use id if name is not available.
That said, we should probably just make it required since it's useful as a display name in our tooling
One thing to note - if we add name as required in the schema for Features, this validation https://github.com/devcontainers/action/blob/main/src/utils.ts#L119 code when publishing with the devcontainers/action will fail if the Feature is missing name.
— Reply to this email directly, view it on GitHub https://github.com/devcontainers/spec/pull/350#discussion_r1471558716, or unsubscribe https://github.com/notifications/unsubscribe-auth/BENKNRHXV5257PEGK7WF46TYRENWRAVCNFSM6AAAAABAUKUTBCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNJRG44DEMZVGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>