Skip to content

Instantly share code, notes, and snippets.

@marvingreenberg
Last active November 22, 2024 19:37
Show Gist options
  • Save marvingreenberg/06636ecb8f8f65f73c61b3bbdf67996f to your computer and use it in GitHub Desktop.
Save marvingreenberg/06636ecb8f8f65f73c61b3bbdf67996f to your computer and use it in GitHub Desktop.
Test yaml schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["name", "version", "repositories"],
"properties": {
"name": { "type": "string" },
"version": { "type": "string" },
"repositories": {
"type": "array",
"items": {
"type": "object",
"required": ["kind", "name", "required_access"],
"properties": {
"kind": {
"type": "string",
"enum": ["generic", "docker", "python", "maven", "npm"]
},
"name": { "type": "string" },
"required_access": {
"type": "string",
"enum": ["read", "write"]
}
}
}
},
"prerequisites": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": ["check"],
"properties": {
"check": { "type": "string" },
"path": { "type": "string" },
"condition": { "type": "string" },
"pattern": { "type": "string" },
"command": { "type": "string" },
"version": { "type": "string" }
}
},
{
"type": "object",
"required": ["any_of"],
"properties": {
"any_of": {
"type": "array",
"items": { "type": "object" }
}
}
}
]
}
}
},
"patternProperties": {
"^[A-Z_]+$": { "type": "string" }
},
"additionalProperties": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment