{
"$schema": "http://json-schema.org/draft/2019-09/schema#",
"title": "JSON SCHEMA for opentestfactory.org/v1alpha1 GeneratorResult manifests",
"type": "object",
"properties": {
"apiVersion": { "const": "opentestfactory.org/v1alpha1" },
"kind": { "const": "GeneratorResult" } ,
"metadata": {
"type": "object",
"properties": {
"name": { "type": "string" },
"workflow_id": { "type": "string" },
"job_id": { "type": "string" },
"job_origin": { "type": "array", "items": { "type": "string" } },
"labels": {
"type": "object",
"patternProperties": {
"^([a-zA-Z0-9-.]+/)?[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$": {
"type": "string"
}
},
"minProperties": 1,
"additionalProperties": false
}
},
"additionalProperties": true,
"required": [ "name", "workflow_id", "job_id", "job_origin" ]
},
"jobs": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"oneOf": [
{ "$ref": "#/definitions/job_generator" },
{ "$ref": "#/definitions/job_steps" }
]
}
},
"minProperties": 1
}
},
"required": [ "apiVersion", "kind", "metadata", "jobs" ],
"additionalProperties": false,
"definitions": {
"defaults": {
"type": "object",
"propertyNames": {
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
}
},
"job_generator": {
"type": "object",
"properties": {
"name": { "type": "string" },
"if": { "type": "string" },
"needs": { "$ref": "#/definitions/needs" },
"variables": { "$ref": "#/definitions/variables" },
"defaults": { "$ref": "#/definitions/defaults" },
"runs-on": { "$ref": "#/definitions/runs-on" },
"strategy": { "type": "object" },
"outputs": { "type": "object" },
"timeout-minutes": { "type": "number" },
"continue-on-error": { "type": "boolean" },
"generator": { "type": "string" },
"with": { "type": "object" }
},
"required": [ "generator" ],
"additionalProperties": false
},
"job_steps": {
"type": "object",
"properties": {
"name": { "type": "string" },
"if": { "type": "string" },
"needs": { "$ref": "#/definitions/needs" },
"variables": { "$ref": "#/definitions/variables" },
"defaults": { "$ref": "#/definitions/defaults" },
"runs-on": { "$ref": "#/definitions/runs-on" },
"strategy": { "type": "object" },
"outputs": { "type": "object" },
"timeout-minutes": { "type": "number" },
"continue-on-error": { "type": "boolean" },
"steps": {
"type": "array",
"minItems": 1,
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"name": { "type": "string" },
"id": { "type": "string" },
"if": { "type": "string" },
"uses": { "type": "string" },
"with": { "type": "object" },
"variables": { "$ref": "#/definitions/variables" },
"timeout-minutes": { "type": "number" },
"continue-on-error": { "type": "boolean" },
"working-directory": { "type": "string" }
},
"required": [ "uses" ],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"id": { "type": "string" },
"if": { "type": "string" },
"run": { "type": "string" },
"variables": { "$ref": "#/definitions/variables" },
"timeout-minutes": { "type": "number" },
"continue-on-error": { "type": "boolean" },
"working-directory": { "type": "string" }
},
"required": [ "run" ],
"additionalProperties": false
}
]
}
}
},
"required": [ "steps" ],
"additionalProperties": false
},
"needs": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$"
}
}
]
},
"runs-on": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
},
{
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
},
"minItems": 1
}
]
},
"variables": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_]+$": { "type": "string" }
},
"minProperties": 1
}
}
}