{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type": "object",
    "properties": {
        "attributes": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "min": {
                        "type": "integer"
                    },
                    "max": {
                        "type": "integer"
                    },
                    "featureId": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "min",
                    "max",
                    "featureId"
                ]
            }
        },
        "contexts": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "min": {
                        "type": "integer"
                    },
                    "max": {
                        "type": "integer"
                    }
                },
                "required": [
                    "id",
                    "min",
                    "max"
                ]
            }
        },
        "configuration": {
            "type": "object",
            "properties": {
                "selectedFeatures": {
                    "description": "initial selected features. If no features are selected this key is optional",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "attribute_values": {
                    "description": "initial values of the attributes if any. If no attributes are present this key is optional",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "value": {
                                "type": "integer"
                            }
                        },
                        "required": [
                            "id",
                            "value"
                        ]
                    }
                },
                "context_values": {
                    "description": "initial values of the context if any. If no context are present this key is optional",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "value": {
                                "type": "integer"
                            }
                        },
                        "required": [
                            "id",
                            "value"
                        ]
                    }
                }
            },
            "required": []
        },
        "constraints": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "preferences": {
            "description": "list of expression to maximize. If boolean expressions the goal is to satisfy them",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "smt_constraints": {
            "description": "constraints given in smt format (faster to parse)",
            "properties": {
                "features": {
                    "description": "declared features. Not needed in case the option --features-as-boolean is selected",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "formulas": {
                    "description": "list of constraints in SMTLib 2 format",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                }
            },
            "type": "object"
        },
        "context_constraints": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "optional_features": {
            "type": "object",
            "description": "Map or the optional feature ids with a list representing their time validity if there is evolution, empty list otherwise.",
            "additionalProperties": {
                "type": "array",
                "description": "List of two element list representing the time bounds if evolution is considered, empty list otherwise.",
                "items": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    },
                    "description": "The bounds of the time validity if evolution is considered. Extremes included."
                }
            }
        },
        "time_context": {
            "type": "string",
            "description": "Optional filed used to indicate in case there is evolution which context id represent the time.",
            "examples": [
                "context_id"
            ]
        }
    },
    "required": [
        "attributes",
        "contexts",
        "configuration",
        "constraints",
        "preferences"
    ]
}