{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "css.json",
    "title": "CSS Optimization Configuration",
    "description": "Schema for CSS Optimization Configuration JSON.",
    "type": "object",
    "properties": {
        "master": {
            "type": "boolean"
        },
        "minify": {
            "$ref": "css-minify.json#"
        },
        "async": {
            "$ref": "css-async.json#"
        },
        "url_filter": {
            "title": "URL filter",
            "type": "object",
            "properties": {
                "enabled": {
                    "title": "Filter stylesheet URLs",
                    "type": "boolean",
                    "default": false
                },
                "config": {
                    "type": "array",
                    "items": {
                        "oneOf": [{
                            "title": "URL ignore filter",
                            "type": "object",
                            "properties": {
                                "url": {
                                    "title": "A string or regular expression to match an URL.",
                                    "type": "string"
                                },
                                "regex": {
                                    "title": "Regular expression match",
                                    "type": "boolean",
                                    "default": false
                                },
                                "ignore": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ],
                                    "default": true
                                }
                            },
                            "required": ["url", "ignore"],
                            "additionalProperties": false
                        }, {
                            "title": "URL delete filter",
                            "type": "object",
                            "properties": {
                                "url": {
                                    "title": "A string or regular expression to match an URL.",
                                    "type": "string"
                                },
                                "regex": {
                                    "title": "Regular expression match",
                                    "type": "boolean",
                                    "default": false
                                },
                                "delete": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ],
                                    "default": true
                                }
                            },
                            "required": ["url", "delete"],
                            "additionalProperties": false
                        }, {
                            "title": "URL convert filter",
                            "type": "object",
                            "properties": {
                                "url": {
                                    "title": "A string or regular expression to match an URL.",
                                    "type": "string"
                                },
                                "regex": {
                                    "title": "Regular expression match",
                                    "type": "boolean",
                                    "default": false
                                },
                                "replace": {
                                    "title": "The URL to replace a matched URL with, used for caching and processing.",
                                    "type": "string",
                                    "format": "uri"
                                }
                            },
                            "required": ["url", "replace"],
                            "additionalProperties": false
                        }]
                    },
                    "uniqueItems": true
                }
            },
            "additionalProperties": false
        },
        "http2_push": {
            "title": "HTTP/2 Server Push",
            "type": "object",
            "properties": {
                "enabled": {
                    "title": "Push stylesheets",
                    "type": "boolean",
                    "default": false
                },
                "filter": {
                    "title": "HTTP/2 Server Push Filter",
                    "type": "object",
                    "properties": {
                        "enabled": {
                            "title": "Filter stylesheets to push",
                            "type": "boolean",
                            "default": false
                        },
                        "type": {
                            "title": "Filter List Type",
                            "type": "string",
                            "enum": [
                                "include",
                                "exclude"
                            ],
                            "default": "include"
                        },
                        "include": {
                            "type": "array",
                            "items": {
                                "title": "Stylesheets to include in push.",
                                "type": "string"
                            },
                            "uniqueItems": true
                        },
                        "exclude": {
                            "type": "array",
                            "items": {
                                "title": "Stylesheets to exclude in push.",
                                "type": "string"
                            },
                            "uniqueItems": true
                        }
                    },
                    "additionalProperties": false
                }
            }
        },
        "replace": {
            "title": "CSS search and replace",
            "description": "This option enables to replace strings in the CSS.",
            "type": "array",
            "items": {
                "oneOf": [{
                    "title": "String Match",
                    "type": "object",
                    "properties": {
                        "search": {
                            "type": "string"
                        },
                        "replace": {
                            "type": "string"
                        },
                        "case": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    "required": [
                        "search",
                        "replace"
                    ],
                    "additionalProperties": false
                }, {
                    "title": "Regular Expression Match",
                    "type": "object",
                    "properties": {
                        "search": {
                            "type": "string"
                        },
                        "replace": {
                            "type": "string"
                        },
                        "regex": {
                            "title": "Regular expression",
                            "type": "boolean",
                            "enum": [
                                true
                            ]
                        }
                    },
                    "required": [
                        "search",
                        "replace",
                        "regex"
                    ],
                    "additionalProperties": false
                }]
            },
            "uniqueItems": true
        },
        "proxy": {
            "$ref": "proxy.json#"
        },
        "cdn": {
            "$ref": "cdn.json#"
        },
        "clean-css": {
            "$ref": "css-clean-css.json#"
        },
        "critical": {
            "$ref": "css-critical.json#"
        },
        "lint": {
            "$ref": "css-lint.json#"
        },
        "autoprefix": {
            "$ref": "css-autoprefix.json#"
        },
        "beautify": {
            "$ref": "css-beautify.json#"
        }
    },
    "json-type": "object",
    "additionalProperties": false
}