{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://happyauto.co.kr/guides/used-car-export-hsk-codes/2026-used-car-hsk-8703.schema.json",
  "title": "2026 HSK 제8703호 중고차 15개 코드 데이터셋",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "dataset_name",
    "dataset_version",
    "reference_year",
    "published_on",
    "verified_on",
    "language",
    "spatial_coverage",
    "record_count",
    "selection_rule",
    "limitations",
    "source",
    "curation",
    "field_provenance",
    "records"
  ],
  "properties": {
    "$schema": { "const": "https://happyauto.co.kr/guides/used-car-export-hsk-codes/2026-used-car-hsk-8703.schema.json" },
    "dataset_name": { "type": "string", "minLength": 1 },
    "dataset_version": { "const": "2026.1" },
    "reference_year": { "const": 2026 },
    "published_on": { "type": "string", "format": "date" },
    "verified_on": { "type": "string", "format": "date" },
    "language": { "const": "ko-KR" },
    "spatial_coverage": { "const": "대한민국" },
    "record_count": { "const": 15 },
    "selection_rule": { "type": "string", "minLength": 1 },
    "limitations": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": ["provider", "dataset_name", "dataset_url", "clip_search_url", "license_name", "license_url"],
      "properties": {
        "provider": { "const": "관세청" },
        "dataset_name": { "const": "관세청_HS부호_20260101" },
        "dataset_url": { "const": "https://www.data.go.kr/data/15049722/fileData.do" },
        "clip_search_url": { "type": "string", "format": "uri" },
        "license_name": { "const": "공공누리 제1유형(출처표시)" },
        "license_url": { "const": "https://www.kogl.or.kr/info/licenseType1.do" }
      }
    },
    "curation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["creator", "legal_operator", "page_url"],
      "properties": {
        "creator": { "const": "해피오토" },
        "legal_operator": { "const": "해피무역" },
        "page_url": { "const": "https://happyauto.co.kr/guides/used-car-export-hsk-codes/" }
      }
    },
    "field_provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": ["official_source_fields", "official_lookup_fields", "happyauto_normalized_fields", "note"],
      "properties": {
        "official_source_fields": { "const": ["hsk_code", "item_name_ko", "item_name_en"] },
        "official_lookup_fields": { "const": ["display_code", "official_detail_url"] },
        "happyauto_normalized_fields": { "const": ["powertrain_key", "powertrain_ko", "engine_or_charging_class_ko"] },
        "note": { "type": "string", "minLength": 1 }
      }
    },
    "records": {
      "type": "array",
      "minItems": 15,
      "maxItems": 15,
      "items": { "$ref": "#/$defs/record" }
    }
  },
  "$defs": {
    "record": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "hsk_code",
        "display_code",
        "powertrain_key",
        "powertrain_ko",
        "engine_or_charging_class_ko",
        "item_name_ko",
        "item_name_en",
        "official_detail_url"
      ],
      "properties": {
        "hsk_code": { "type": "string", "pattern": "^8703[0-9]{6}$" },
        "display_code": { "type": "string", "pattern": "^8703\\.[0-9]{2}-[0-9]{4}$" },
        "powertrain_key": { "enum": ["spark", "compression", "hybrid", "plugin", "electric"] },
        "powertrain_ko": { "type": "string", "minLength": 1 },
        "engine_or_charging_class_ko": { "type": "string", "minLength": 1 },
        "item_name_ko": { "const": "중고차" },
        "item_name_en": { "const": "Used" },
        "official_detail_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://unipass\\.customs\\.go\\.kr/clip/hsinfosrch/openULS0201007Q\\.do\\?opnMod=P&searchVal=8703[0-9]{6}$"
        }
      }
    }
  }
}
