{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "extends": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "server": {
      "$ref": "#/definitions/server"
    },
    "globals": {
      "$ref": "#/definitions/globals"
    },
    "plugins": {
      "$ref": "#/definitions/plugins"
    },
    "template": {
      "type": "object",
      "additionalProperties": true
    },
    "$schema": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "definitions": {
    "server": {
      "type": "object",
      "properties": {
        "listener": {
          "type": "object",
          "properties": {
            "port": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 65535
                },
                {
                  "type": "string",
                  "minLength": 1
                }
              ]
            },
            "host": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "logLevel": {
          "type": "string",
          "enum": [
            "fatal",
            "error",
            "warn",
            "info",
            "debug",
            "trace",
            "silent"
          ]
        },
        "logFormat": {
          "type": "string",
          "enum": [
            "json",
            "pretty"
          ]
        },
        "options": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "globals": {
      "type": "object",
      "additionalProperties": true
    },
    "plugin": {
      "type": "object",
      "properties": {
        "order": {
          "type": "number",
          "minimum": 0
        },
        "module": {
          "type": "string",
          "minLength": 1
        },
        "paths": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "methods": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "hosts": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "config": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "required": [
        "module"
      ],
      "additionalProperties": false
    },
    "plugins": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "$ref": "#/definitions/plugin"
        }
      }
    }
  }
}
