{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {},
    "properties": {
        "class": {
            "description": "Name of the target class",
            "type": "string"
        },
        "scenarios": {
            "description": "list of possible deploying scenarios",
            "items": {
                "properties": {
                    "cost": {
                        "description": "mapping resource name: cost",
                        "properties": {
                            "additionalProperties": {
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    },
                    "methods": {
                        "description": "list of methods to add and remove preferences",
                        "items": {
                            "properties": {
                                "add": {
                                    "description": "method to add the reference",
                                    "properties": {
                                        "name": {
                                            "description": "method name",
                                            "type": "string"
                                        },
                                        "param_type": {
                                            "description": "type of the object added",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "param_type"
                                    ]
                                },
                                "remove": {
                                    "description": "method to remove the reference",
                                    "properties": {
                                        "name": {
                                            "description": "method name",
                                            "type": "string"
                                        },
                                        "param_type": {
                                            "description": "type of the object added (may be absent)",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "name"
                                    ]
                                }
                            },
                            "type": "object",
                            "required": [
                                "add"
                            ]
                        },
                        "type": "array"
                    },
                    "name": {
                        "description": "name of the scenario (must be unique in the array)",
                        "type": "string"
                    },
                    "provide": {
                        "description": "Number of functionalities provide (-1 unbounded)",
                        "type": "integer"
                    },
                    "sig": {
                        "items": {
                            "anyOf": [
                                {
                                    "properties": {
                                        "kind": {
                                            "description": "require an object generated by SmartDeployer",
                                            "type": "string",
                                            "enum": [
                                                "require"
                                            ]
                                        },
                                        "type": {
                                            "description": "interface of the object to add as parameter",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "kind",
                                        "type"
                                    ]
                                },
                                {
                                    "properties": {
                                        "kind": {
                                            "description": "constant parameter",
                                            "type": "string",
                                            "enum": [
                                                "constant"
                                            ]
                                        },
                                        "value": {
                                            "description": "value of the parameter",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "kind",
                                        "value"
                                    ]
                                },
                                {
                                    "properties": {
                                        "kind": {
                                            "description": "list of required objects",
                                            "type": "string",
                                            "enum": [
                                                "list"
                                            ]
                                        },
                                        "type": {
                                            "description": "interface of the objects to add as parameters",
                                            "type": "string"
                                        },
                                        "num": {
                                            "description": "minimal lenght of the list",
                                            "type": "number"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "kind",
                                        "type",
                                        "num"
                                    ]
                                }
                            ]
                        },
                        "type": "array"
                    }
                },
                "type": "object",
                "required": [
                    "name",
                    "sig",
                    "provide",
                    "cost",
                    "methods"
                ]
            },
            "type": "array"
        }
    },
    "type": "object",
    "required": [
        "class",
        "scenarios"
    ]
}