{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tradedashboard-eu/json-schema/tradedashboard-eu-recent-search-req-schema.json",
  "title": "RecentSearchReq",
  "description": "One dashboard search to remember on the user's account: every query\nparameter from the dashboard URL except the palette. Field defaults\nmirror the dashboard's own.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tradedashboard-eu-openapi.json#/components/schemas/RecentSearchReq",
  "properties": {
    "reporter": {
      "type": "string",
      "maxLength": 120,
      "title": "Reporter",
      "description": "Declaring entity: an EU Member State, an EU candidate country, Northern Ireland ('XI'), or one of the three aggregate presets ('European Union', 'Euro area', 'EU candidate countries'), or a predefined reporter group name.",
      "default": "European Union"
    },
    "group_reporters": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "maxLength": 120
          },
          "type": "array",
          "maxItems": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Group Reporters",
      "description": "Explicit reporters for a custom reporter group. Each entry must be an EU Member State, EU candidate country, or Northern Ireland. When more than one is supplied the frame is aggregated into a synthetic group named after 'reporter'."
    },
    "partner_set": {
      "type": "string",
      "maxLength": 120,
      "title": "Partner Set",
      "description": "Named partner preset, e.g. 'non-EU countries', 'EU countries', 'all countries', or a predefined partner group.",
      "default": "non-EU countries"
    },
    "partners": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "maxLength": 120
          },
          "type": "array",
          "maxItems": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Partners",
      "description": "Explicit partner-country list that overrides 'partner_set' when present."
    },
    "period_start": {
      "type": "string",
      "pattern": "\\d{4}-\\d{2}",
      "title": "Period Start",
      "description": "Inclusive start of the analysis window, ISO month 'YYYY-MM'.",
      "default": {
        "year": 2015,
        "month": 1
      }
    },
    "frequency": {
      "$ref": "#/$defs/Frequency",
      "description": "Resampling frequency for the series: 'month', 'quarter' or 'year'.",
      "default": "quarter"
    },
    "remove_outliers": {
      "type": "boolean",
      "title": "Remove Outliers",
      "description": "Drop extreme unit-price outliers before computing weighted-average prices.",
      "default": true
    },
    "name": {
      "type": "string",
      "title": "Name",
      "default": ""
    },
    "period_end": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "\\d{4}-\\d{2}",
          "description": "A calendar month, 'YYYY-MM'."
        },
        {
          "type": "null"
        }
      ],
      "title": "Period End"
    },
    "customs_code": {
      "anyOf": [
        {
          "type": "string",
          "description": "A canonical customs code, TOTAL, or a supported residual spelling."
        },
        {
          "items": {
            "type": "string",
            "description": "A canonical customs code, TOTAL, or a supported residual spelling."
          },
          "type": "array",
          "maxItems": 50
        }
      ],
      "title": "Customs Code"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "customs_code"
  ],
  "$defs": {
    "Frequency": {
      "type": "string",
      "enum": [
        "month",
        "quarter",
        "year"
      ],
      "title": "Frequency",
      "description": "The resampling frequency of a series."
    }
  }
}