{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sedirk.cn/lenses/data/schema.json",
  "title": "SEDIRK public lens catalog",
  "type": "object",
  "required": [
    "schema_version",
    "lenses"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "lenses": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "uid",
          "id",
          "vendor",
          "model",
          "known_parameters",
          "observations",
          "normalized"
        ],
        "properties": {
          "uid": {
            "type": "string",
            "pattern": "^lens-[0-9a-f]{16}$"
          },
          "id": {
            "type": "string",
            "description": "原库稳定ID；按商家、型号和具体SKU区分"
          },
          "known_parameters": {
            "type": "object",
            "description": "保留原字段名与事实/假设文字；不得以规格相同补写未知处方"
          },
          "normalized": {
            "type": "object",
            "properties": {
              "diameter_mm": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "focal_length_mm": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "所存名义焦距；与处方矛盾时不得忽略冲突"
              },
              "radii_mm": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "有符号曲率按记录原意；null是否为平面必须参考原处方说明"
              },
              "prescription_fields_present": {
                "type": "boolean",
                "description": "仅检查R/t/玻璃数组的字段数量关系，不代表处方正确或已实测"
              },
              "latest_price": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "最近有金额的历史观察；不是实时售价"
              }
            }
          }
        }
      }
    }
  }
}