{
    "definitions": {},
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://dynamicsmobile.com/schema/json/businessobject.json",
    "type": "object",
    "additionalProperties": false,
    "title": "Dynamics Mobile User Interface Task Definition",
    "defaultSnippets": [
        {
            "label": "New Task",
            "description": "Creates default user interface task with one step and no routes",
            "body": { 
                "id":"$1",
                "steps":[
                    {
                        "id":"$2",
                        "view":"$3",
                        "routes":[]
                    }
                ]
             }
        }
    ],
    "required": [
        "id"
    ],
    "properties": {
        "id": {
            "type": "string"
        },
        "help":{
            "type":"string"
        },
        "steps": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "view",
                    "routes"
                ],
                "defaultSnippets": [
                    {
                        "label": "New Step",
                        "description": "Creates a new step",
                        "body": {                             
                                    "id":"$1",
                                    "view":"$2",
                                    "routes":[]
                                }                                             
                    }
                ],
                "properties": {
                    "help":{
                        "type":"string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "view": {
                        "type": "string"
                    },
                    "routes": {
                        "type": "array",                  
                        "items": {
                            "type": "object",
                            "required": [
                                "id",
                                "target"
                            ],
                            "defaultSnippets": [
                                {
                                    "label": "New Route",
                                    "description": "Creates a new route in the current step",
                                    "body": {                             
                                                "id":"$1",
                                                "target":"$2",
                                                "validate":false
                                            }                                             
                                }
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "help":{
                                    "type":"string"
                                },
                                "id": {
                                    "type": "string"
                                },
                                "target": {
                                    "type": "string"
                                },
                                "validate": {
                                    "type": "boolean"
                                },
                                "preserveContext": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}