{
    "title": "retry",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.jobscheduler.model.instruction.RetryCatch",
    "type": "object",
    "required": [
        "try",
        "catch"
    ],
    "extends": {
        "javaType": "com.sos.jobscheduler.model.instruction.Instruction",
        "type": "object",
        "required": [
            "TYPE"
        ],
        "properties": {
            "TYPE": {
                "javaType": "com.sos.jobscheduler.model.instruction.InstructionType",
                "type": "string",
                "enum": [
                    "Execute.Named",
                    "If",
                    "Try",
                    "Fork",
                    "Finish",
                    "Fail",
                    "Retry",
                    "Publish",
                    "Await"
                ]
            },
            "position": {
                "description": "Actually, each even item is a string, each odd item is an integer",
                "type": "array",
                "items": {
                    "anyOf": [
                        {
                            "type": "integer"
                        },
                        {
                            "type": "string"
                        }
                    ]
                }
            }
        },
        "additionalProperties": false
    },
    "propertyOrder": [
        "TYPE",
        "maxTries",
        "retryDelays",
        "try",
        "catch"
    ],
    "description": "instruction with fixed property 'TYPE':'Try' (with a retry object in the catch)",
    "properties": {
        "maxTries": {
            "type": "integer",
            "minimum": 0
        },
        "retryDelays": {
            "type": "array",
            "items": {
                "type": "integer",
                "minimum": 0
            }
        },
        "try": {
            "type": "object",
            "javaType": "com.sos.jobscheduler.model.instruction.Instructions",
            "required": [
                "instructions"
            ],
            "properties": {
                "instructions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "javaType": "com.sos.jobscheduler.model.instruction.Instruction",
                        "type": "object",
                        "required": [
                            "TYPE"
                        ],
                        "properties": {
                            "TYPE": {
                                "javaType": "com.sos.jobscheduler.model.instruction.InstructionType",
                                "type": "string",
                                "enum": [
                                    "Execute.Named",
                                    "If",
                                    "Try",
                                    "Fork",
                                    "Finish",
                                    "Fail",
                                    "Retry",
                                    "Publish",
                                    "Await"
                                ]
                            },
                            "position": {
                                "description": "Actually, each even item is a string, each odd item is an integer",
                                "type": "array",
                                "items": {
                                    "anyOf": [
                                        {
                                            "type": "integer"
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        },
                        "additionalProperties": false
                    }
                }
            },
            "additionalProperties": false
        },
        "catch": {
            "type": "object",
            "javaType": "com.sos.jobscheduler.model.instruction.OptionalInstructions",
            "description": "only for the validation, not used as pojo",
            "required": [
                "instructions"
            ],
            "properties": {
                "instructions": {
                    "type": "array",
                    "items": {
                        "javaType": "com.sos.jobscheduler.model.instruction.Instruction",
                        "type": "object",
                        "required": [
                            "TYPE"
                        ],
                        "properties": {
                            "TYPE": {
                                "javaType": "com.sos.jobscheduler.model.instruction.InstructionType",
                                "type": "string",
                                "enum": [
                                    "Execute.Named",
                                    "If",
                                    "Try",
                                    "Fork",
                                    "Finish",
                                    "Fail",
                                    "Retry",
                                    "Publish",
                                    "Await"
                                ]
                            },
                            "position": {
                                "description": "Actually, each even item is a string, each odd item is an integer",
                                "type": "array",
                                "items": {
                                    "anyOf": [
                                        {
                                            "type": "integer"
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        },
                        "additionalProperties": false
                    }
                }
            },
            "additionalProperties": false
        }
    },
    "additionalProperties": false
}