{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://blog.jasonsuhari.com/schemas/mapbox-3d-city-evidence.schema.json",
  "title": "Mapbox 3D City Review Evidence",
  "type": "object",
  "required": [
    "schemaVersion",
    "library",
    "libraryVersion",
    "style",
    "testedAt",
    "city",
    "userAgent",
    "devicePixelRatio",
    "viewport",
    "firstIdleMs",
    "webgl",
    "frameTest",
    "errors",
    "camera",
    "capture"
  ],
  "properties": {
    "schemaVersion": { "const": 1 },
    "library": { "const": "Mapbox GL JS" },
    "libraryVersion": { "type": "string" },
    "style": { "const": "mapbox://styles/mapbox/standard" },
    "testedAt": { "type": "string", "format": "date-time" },
    "city": { "type": "string" },
    "userAgent": { "type": "string" },
    "devicePixelRatio": { "type": "number", "exclusiveMinimum": 0 },
    "viewport": {
      "type": "object",
      "required": ["width", "height"],
      "properties": {
        "width": { "type": "integer", "minimum": 1 },
        "height": { "type": "integer", "minimum": 1 }
      },
      "additionalProperties": false
    },
    "firstIdleMs": { "type": "number", "minimum": 0 },
    "webgl": { "type": "string" },
    "frameTest": {
      "type": "object",
      "required": [
        "durationMs",
        "frames",
        "averageFps",
        "medianFrameMs",
        "p95FrameMs",
        "longestFrameMs",
        "city",
        "lightPreset",
        "weather",
        "show3dObjects",
        "show3dFacades"
      ],
      "properties": {
        "durationMs": { "type": "number", "minimum": 5900 },
        "frames": { "type": "integer", "minimum": 1 },
        "averageFps": { "type": "number", "exclusiveMinimum": 0 },
        "medianFrameMs": { "type": "number", "minimum": 0 },
        "p95FrameMs": { "type": "number", "minimum": 0 },
        "longestFrameMs": { "type": "number", "minimum": 0 },
        "city": { "type": "string" },
        "lightPreset": { "enum": ["dawn", "day", "dusk", "night"] },
        "weather": { "enum": ["clear", "rain", "snow"] },
        "show3dObjects": { "type": "boolean" },
        "show3dFacades": { "type": "boolean" }
      }
    },
    "errors": { "type": "array" },
    "camera": {
      "type": "object",
      "required": ["center", "zoom", "pitch", "bearing"]
    },
    "capture": {
      "type": "object",
      "required": ["browserMode", "pageErrors", "networkFailures"],
      "properties": {
        "browserMode": { "type": "string" },
        "pageErrors": { "type": "array" },
        "networkFailures": { "type": "array" }
      }
    }
  }
}
