{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://gitea.dsv.su.se/DMC/apimposter/mocks.schema.json", "title": "APImposter mocks configuration schema", "description": "Schema for APImposter YAML configuration files", "type": "array", "items": { "type": "object", "required": ["method", "path"], "oneOf": [ { "required": ["response"], "properties": { "method": { "$ref": "#/$defs/httpMethod" }, "path": { "type": "string" }, "response": { "$ref": "#/$defs/response" } } }, { "required": ["conditionalResponses"], "properties": { "method": { "$ref": "#/$defs/httpMethod" }, "path": { "type": "string" }, "conditionalResponses": { "$ref": "#/$defs/conditionalResponses" } } } ] }, "$defs": { "httpMethod": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"] }, "response": { "type": "object", "properties": { "status": { "type": "integer" }, "headers": { "type": "object" }, "body": { "type": ["string", "object", "array", "number", "boolean"] }, "delay": { "type": "integer" } } }, "conditionalResponses": { "type": "object", "required": ["conditions"], "properties": { "conditions": { "type": "object", "properties": { "path": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response" } }, "query": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response" } }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response" } }, "body": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response" } } } }, "response": { "$ref": "#/$defs/response" } } } } }