{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/deputy/json-schema/deputy-query-request-schema.json",
  "title": "QueryRequest",
  "description": "V1 Resource search payload. All fields optional; an empty body returns the first page of results.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/deputy-address-api-openapi.yml#/components/schemas/QueryRequest",
  "type": "object",
  "properties": {
    "search": {
      "type": "object",
      "description": "Map of search clauses keyed by an arbitrary id (e.g. `s1`, `s2`). Each clause filters one field.",
      "additionalProperties": {
        "type": "object",
        "required": [
          "field",
          "data",
          "type"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Field name to filter on (e.g. `Id`, `Employee`)."
          },
          "data": {
            "description": "Comparison value. Type depends on the field."
          },
          "type": {
            "type": "string",
            "description": "Comparison operator.",
            "enum": [
              "eq",
              "ne",
              "gt",
              "lt",
              "ge",
              "le",
              "is",
              "is not",
              "in",
              "not in",
              "starts",
              "contains"
            ]
          }
        }
      }
    },
    "sort": {
      "type": "object",
      "description": "Map of field name → `asc` or `desc`.",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ]
      }
    },
    "start": {
      "type": "integer",
      "minimum": 0,
      "default": 0,
      "description": "Pagination offset (0-indexed)."
    },
    "max": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500,
      "default": 100,
      "description": "Max records per page (server caps at 500)."
    },
    "join": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Related ORMs to expand inline (e.g. `[\"EmployeeObject\"]`)."
    }
  }
}