{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/httpmockrc/latest.json",
  "title": "Http-mocker configuration.",
  "description": "A tool for mock local requests or proxy remote requests.",
  "x-lintel": {
    "source": "https://www.schemastore.org/httpmockrc.json",
    "sourceSha256": "10f8689c7f9d274d560a1a2f757909d9716944a0b3d743351151fc3850116e48",
    "fileMatch": [
      ".httpmockrc",
      ".httpmock.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "mockFileName": {
      "default": "mocks",
      "type": "string",
      "description": "Root of mock files"
    },
    "requestHeaders": {
      "type": "object",
      "description": "Custom request header"
    },
    "responseHeaders": {
      "type": "object",
      "description": "Custom response header"
    },
    "parseBody": {
      "type": "boolean",
      "description": "Parse post body by express.json()"
    },
    "routes": {
      "type": "object",
      "description": "Rules for proxy and mock",
      "patternProperties": {
        "^.*$": {
          "type": "object",
          "description": "Rule of Matching route",
          "properties": {
            "path": {
              "type": "string",
              "description": "Where Mock result file located"
            },
            "ignore": {
              "type": "boolean",
              "description": "Whether to ignore this rule, generally used for remote interfaces instead of mock in the local"
            },
            "delay": {
              "type": "number",
              "description": "How many milliseconds are delayed to return a request, general used for control the request sequence"
            },
            "validate": {
              "type": "object",
              "description": "Validate params in body by key and typeof value"
            }
          },
          "required": [
            "path"
          ]
        }
      }
    }
  },
  "required": [
    "mockFileName",
    "routes"
  ]
}
