{
    "$ref": "#/definitions/WebApiSchema",
    "definitions": {
        "WebApiSchema": {
            "type": "object",
            "properties": {
                "webApiVersion": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d+\\.\\d+(\\.\\d+)?$"
                },
                "api": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "url": {
                                "type": "string"
                            },
                            "httpMethod": {
                                "type": "string",
                                "enum": [
                                    "get",
                                    "post"
                                ]
                            },
                            "headers": {
                                "type": "object",
                                "additionalProperties": {}
                            },
                            "queryArgs": {
                                "type": "object",
                                "additionalProperties": {}
                            },
                            "body": {
                                "type": "object",
                                "properties": {},
                                "additionalProperties": false
                            },
                            "bodies": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "condition": {
                                            "type": "string"
                                        },
                                        "body": {
                                            "type": "object",
                                            "properties": {},
                                            "additionalProperties": false
                                        },
                                        "break": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "condition",
                                        "body"
                                    ],
                                    "additionalProperties": false
                                }
                            },
                            "bodyType": {
                                "type": "string",
                                "enum": [
                                    "json",
                                    "x-www-form-urlencoded"
                                ]
                            },
                            "auth": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "bearerToken",
                                            "basicUserPassword",
                                            "oauth2"
                                        ]
                                    },
                                    "token": {
                                        "type": "string"
                                    },
                                    "username": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "sendTokenInParameters": {
                                        "type": "boolean"
                                    },
                                    "oauth2GrantType": {
                                        "type": "string",
                                        "enum": [
                                            "clientCredentials",
                                            "password",
                                            "authCode"
                                        ]
                                    },
                                    "oauth2TokenUrl": {
                                        "type": "string"
                                    },
                                    "oauth2Scope": {
                                        "type": "string"
                                    },
                                    "oauth2ClientSecretLocationDuringAuth": {
                                        "type": "string",
                                        "enum": [
                                            "query",
                                            "header",
                                            "body"
                                        ]
                                    },
                                    "oauth2ClientId": {
                                        "type": "string"
                                    },
                                    "oauth2ClientSecret": {
                                        "type": "string"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "queryArg",
                                            "header"
                                        ]
                                    },
                                    "path": {
                                        "type": "string"
                                    },
                                    "suggestedValue": {
                                        "type": [
                                            "string",
                                            "number",
                                            "boolean"
                                        ]
                                    }
                                },
                                "required": [
                                    "type",
                                    "mode",
                                    "path"
                                ],
                                "additionalProperties": false
                            },
                            "xmlPayload": {
                                "type": "boolean"
                            },
                            "dataPath": {
                                "type": "string"
                            },
                            "isScalar": {
                                "type": "boolean"
                            },
                            "pagingModel": {
                                "type": "string",
                                "enum": [
                                    "offset",
                                    "nextUrl",
                                    "token"
                                ]
                            },
                            "pagingOptions": {
                                "type": "object",
                                "properties": {
                                    "baseUrlTemplate": {
                                        "type": "string"
                                    }
                                },
                                "additionalProperties": false
                            },
                            "pageSizeIn": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/auth/properties/mode"
                                    },
                                    "path": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/auth/properties/path"
                                    },
                                    "suggestedValue": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/auth/properties/suggestedValue"
                                    }
                                },
                                "required": [
                                    "mode",
                                    "path"
                                ],
                                "additionalProperties": false
                            },
                            "nextUrlOut": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "webLink",
                                            "header",
                                            "payload"
                                        ]
                                    },
                                    "path": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "mode",
                                    "path"
                                ],
                                "additionalProperties": false
                            },
                            "nextTokenIn": {
                                "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/pageSizeIn"
                            },
                            "nextTokenOut": {
                                "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextUrlOut"
                            },
                            "nextOffsetIn": {
                                "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/pageSizeIn"
                            },
                            "retryAfter": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextUrlOut/properties/mode"
                                    },
                                    "path": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextUrlOut/properties/path"
                                    },
                                    "expression": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "mode",
                                    "path"
                                ],
                                "additionalProperties": false
                            },
                            "status": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "condition": {
                                            "type": "string"
                                        },
                                        "result": {
                                            "type": "string",
                                            "enum": [
                                                "error",
                                                "warning",
                                                "throttled"
                                            ]
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "name",
                                        "condition",
                                        "result"
                                    ],
                                    "additionalProperties": false
                                }
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "url",
                            "httpMethod",
                            "name"
                        ],
                        "additionalProperties": false
                    }
                },
                "lookUps": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "api": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/url"
                                    },
                                    "httpMethod": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/httpMethod"
                                    },
                                    "headers": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/headers"
                                    },
                                    "queryArgs": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/queryArgs"
                                    },
                                    "body": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/body"
                                    },
                                    "bodies": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/bodies"
                                    },
                                    "bodyType": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/bodyType"
                                    },
                                    "auth": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/auth"
                                    },
                                    "xmlPayload": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/xmlPayload"
                                    },
                                    "dataPath": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/dataPath"
                                    },
                                    "isScalar": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/isScalar"
                                    },
                                    "pagingModel": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/pagingModel"
                                    },
                                    "pagingOptions": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/pagingOptions"
                                    },
                                    "pageSizeIn": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/pageSizeIn"
                                    },
                                    "nextUrlOut": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextUrlOut"
                                    },
                                    "nextTokenIn": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextTokenIn"
                                    },
                                    "nextTokenOut": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextTokenOut"
                                    },
                                    "nextOffsetIn": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/nextOffsetIn"
                                    },
                                    "retryAfter": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/retryAfter"
                                    },
                                    "status": {
                                        "$ref": "#/definitions/WebApiSchema/properties/api/items/properties/status"
                                    },
                                    "extends": {
                                        "type": "string"
                                    }
                                },
                                "additionalProperties": false
                            },
                            "result": {
                                "type": "object",
                                "properties": {
                                    "path": {
                                        "type": "string"
                                    },
                                    "groupBy": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "path"
                                ],
                                "additionalProperties": false
                            }
                        },
                        "required": [
                            "name",
                            "result"
                        ],
                        "additionalProperties": false
                    }
                },
                "dataTransforms": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "flags": {
                                "type": "boolean"
                            },
                            "map": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "from": {},
                                        "to": {}
                                    },
                                    "additionalProperties": false
                                }
                            },
                            "default": {}
                        },
                        "required": [
                            "name",
                            "map"
                        ],
                        "additionalProperties": false
                    }
                },
                "testConfig": {
                    "type": "object",
                    "properties": {
                        "apis": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/WebApiSchema/properties/lookUps/items/properties/api"
                            }
                        },
                        "helpUrl": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "apis"
                    ],
                    "additionalProperties": false
                },
                "import": {
                    "type": "object",
                    "properties": {
                        "types": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string"
                                    },
                                    "sourceType": {
                                        "type": "string"
                                    },
                                    "api": {
                                        "$ref": "#/definitions/WebApiSchema/properties/lookUps/items/properties/api"
                                    },
                                    "fields": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "name": {
                                                    "type": "string"
                                                },
                                                "condition": {
                                                    "type": "string"
                                                },
                                                "convertToString": {
                                                    "type": "boolean"
                                                },
                                                "convertToDate": {
                                                    "type": "boolean"
                                                },
                                                "dateFormat": {
                                                    "type": "string",
                                                    "enum": [
                                                        "ISO",
                                                        "Unix"
                                                    ]
                                                },
                                                "calc": {
                                                    "type": "array",
                                                    "items": {
                                                        "anyOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "condition": {
                                                                        "type": "string"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "expression": {
                                                                        "type": "string"
                                                                    }
                                                                },
                                                                "required": [
                                                                    "name",
                                                                    "expression"
                                                                ],
                                                                "additionalProperties": false
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "condition": {
                                                                        "type": "string"
                                                                    },
                                                                    "name": {
                                                                        "type": "string"
                                                                    },
                                                                    "lookUp": {
                                                                        "type": "string"
                                                                    },
                                                                    "args": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object",
                                                                            "properties": {
                                                                                "name": {
                                                                                    "type": "string"
                                                                                },
                                                                                "arg": {}
                                                                            },
                                                                            "required": [
                                                                                "name"
                                                                            ],
                                                                            "additionalProperties": false
                                                                        }
                                                                    }
                                                                },
                                                                "required": [
                                                                    "name",
                                                                    "lookUp"
                                                                ],
                                                                "additionalProperties": false
                                                            }
                                                        ]
                                                    }
                                                },
                                                "dataTransform": {
                                                    "type": "string"
                                                },
                                                "value": {
                                                    "type": "string"
                                                },
                                                "isTimestamp": {
                                                    "type": "boolean"
                                                },
                                                "distinct": {
                                                    "type": "boolean"
                                                },
                                                "idForSourceId": {
                                                    "type": "string"
                                                },
                                                "displayName": {
                                                    "type": "string"
                                                },
                                                "visible": {
                                                    "type": "boolean"
                                                },
                                                "include": {
                                                    "type": "boolean"
                                                },
                                                "shape": {
                                                    "anyOf": [
                                                        {
                                                            "anyOf": [
                                                                {
                                                                    "not": {}
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "type": "array",
                                                            "minItems": 2,
                                                            "maxItems": 2,
                                                            "items": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "object",
                                                                    "additionalProperties": {}
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "type": "array",
                                                            "minItems": 1,
                                                            "maxItems": 1,
                                                            "items": [
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "label",
                                                        "value",
                                                        "timestamp",
                                                        "unitLabel",
                                                        "id",
                                                        "sourceId",
                                                        "link",
                                                        "none"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "name",
                                                "value"
                                            ],
                                            "additionalProperties": false
                                        }
                                    },
                                    "links": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "label": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "label",
                                                "url"
                                            ],
                                            "additionalProperties": false
                                        }
                                    },
                                    "edges": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "label": {
                                                    "type": "string"
                                                },
                                                "inV": {
                                                    "type": "string"
                                                },
                                                "outV": {
                                                    "type": "string"
                                                },
                                                "forEach": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "label",
                                                "inV",
                                                "outV"
                                            ],
                                            "additionalProperties": false
                                        }
                                    },
                                    "dependentObjects": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/type"
                                                },
                                                "sourceType": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/sourceType"
                                                },
                                                "api": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/api"
                                                },
                                                "fields": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/fields"
                                                },
                                                "links": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/links"
                                                },
                                                "edges": {
                                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/edges"
                                                },
                                                "forEach": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "sourceType",
                                                "fields"
                                            ],
                                            "additionalProperties": false
                                        }
                                    }
                                },
                                "required": [
                                    "type",
                                    "sourceType",
                                    "fields"
                                ],
                                "additionalProperties": false
                            }
                        }
                    },
                    "required": [
                        "types"
                    ],
                    "additionalProperties": false
                },
                "dataSources": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "supportedScope": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "single",
                                    "list"
                                ]
                            },
                            "timeframe": {
                                "type": "object",
                                "properties": {
                                    "format": {
                                        "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/fields/items/properties/dateFormat"
                                    },
                                    "summarizeColumns": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "format"
                                ],
                                "additionalProperties": false
                            },
                            "scope": {
                                "type": "object",
                                "properties": {
                                    "idPath": {
                                        "type": "string"
                                    },
                                    "idSeparator": {
                                        "type": "string"
                                    }
                                },
                                "additionalProperties": false
                            },
                            "preCalc": {
                                "type": "array",
                                "items": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/fields/items/properties/calc/items/anyOf/0"
                                        },
                                        {
                                            "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/fields/items/properties/calc/items/anyOf/1"
                                        }
                                    ]
                                }
                            },
                            "api": {
                                "$ref": "#/definitions/WebApiSchema/properties/lookUps/items/properties/api"
                            },
                            "fields": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/definitions/WebApiSchema/properties/import/properties/types/items/properties/fields/items"
                                }
                            },
                            "filterResults": {
                                "type": "object",
                                "properties": {
                                    "condition": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "condition"
                                ],
                                "additionalProperties": false
                            }
                        },
                        "required": [
                            "name",
                            "supportedScope",
                            "fields"
                        ],
                        "additionalProperties": false
                    }
                },
                "$schema": {
                    "type": "string"
                }
            },
            "required": [
                "webApiVersion",
                "import",
                "dataSources"
            ],
            "additionalProperties": false
        }
    },
    "$schema": "http://json-schema.org/draft-07/schema#"
}