Skip to content

ProviderResult schema

{
    "$schema": "https://json-schema.org/draft/2019-09/schema#",
    "title": "JSON SCHEMA for ProviderResult manifests",
    "type": "object",
    "properties": {
        "apiVersion": {
            "const": "opentestfactory.org/v1beta1"
        },
        "kind": {
            "const": "ProviderResult"
        },
        "metadata": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "workflow_id": {
                    "type": "string"
                },
                "job_id": {
                    "type": "string"
                },
                "job_origin": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "step_id": {
                    "type": "string"
                },
                "step_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",
                "step_id",
                "step_origin"
            ]
        },
        "hooks": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "if": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "minItems": 1
                    },
                    "before": {
                        "type": "array",
                        "minItems": 1
                    },
                    "after": {
                        "type": "array",
                        "minItems": 1
                    }
                },
                "anyOf": [
                    {
                        "required": [
                            "name",
                            "events",
                            "before"
                        ]
                    },
                    {
                        "required": [
                            "name",
                            "events",
                            "after",
                            "before"
                        ]
                    },
                    {
                        "required": [
                            "name",
                            "events",
                            "after"
                        ]
                    }
                ],
                "additionalProperties": false
            }
        },
        "steps": {
            "type": "array",
            "minItems": 0,
            "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": [
        "apiVersion",
        "kind",
        "metadata",
        "steps"
    ],
    "additionalProperties": false,
    "definitions": {
        "variables": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z0-9_]+$": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "object",
                            "properties": {
                                "value": {
                                    "type": "string"
                                },
                                "verbatim": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "value"
                            ],
                            "additionalProperties": false
                        }
                    ]
                }
            },
            "minProperties": 1
        }
    }
}