{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://raw.githubusercontent.com/crescentflare/SmartMockServer/master/smartmockserver_properties_schema.json",
    "title": "Smart mock server: properties schema",
    "description": "Defines the format of the properties file for the endpoints",
    "type": "object",
    "properties": {
        "method": {
            "description": "Restrict requests to the given method (if the methods don't match, the response will be an error)",
            "type": "string",
            "enum": [
                "GET",
                "POST",
                "PUT",
                "DELETE",
                "PATCH"
            ]
        },
        "delay": {
            "description": "Delay the response of a request in milliseconds",
            "type": "integer"
        },
        "name": {
            "description": "Name a request, recommended in combination with other documentation",
            "type": "string"
        },
        "description": {
            "description": "Add an additional description to a request, adds a good improvement to the documentation",
            "type": "string"
        },
        "category": {
            "description": "Use this to group similar requests together into categories, useful to keep the mock server maintainable when more and more requests are being added",
            "type": "string"
        },
        "getParameters": {
            "description": "A list of parameters which will be added to the URL",
            "type": "object"
        },
        "postParameters": {
            "description": "Similar to getParameters, used for requests with a body (the parameters will be part of the request body)",
            "type": "object"
        },
        "postJson": {
            "description": "Used for requests requiring JSON structure in the body data",
            "type": "object"
        },
        "responseCode": {
            "description": "The HTTP result code. If not specified it will fall back to 200 in case of success",
            "type": "integer"
        },
        "alternatives": {
            "description": "Provide alternative responses when certain conditions are met (based on parameters, method, etc.)",
            "type": "array",
            "items": {
                "$ref": "#"
            }
        },
        "generates": {
            "description": "Use this to automatically set up things like an index page or a file server",
            "type": "string",
            "enum": [
                "indexPage",
                "fileList",
                "commandConsole"
            ]
        },
        "redirect": {
            "description": "A path to redirect to. Uses properties, responseBody and other files from the relative path specified by this property",
            "type": "string"
        },
        "generatesJson": {
            "description": "File server only: this will generate the file list as a json response when visiting the index page",
            "type": "boolean"
        },
        "includeSHA256": {
            "description": "File server only: generate an sha256 hash of each file being listed in the json response of the file server, combined with the generatesJson property",
            "type": "boolean"
        },
        "hidden": {
            "description": "Alternative responses only: hide it from the index page",
            "type": "boolean"
        },
        "responsePath": {
            "description": "Alternative responses only: specify the prefix of the alternative response file, if this value is 'alternativeTest', a JSON file being read can be alternativeTest.json",
            "type": "string"
        },
        "checkHeaders": {
            "description": "Alternative responses only: check these headers when finding an alternative response",
            "type": "object"
        }
    }
}