{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gpuatlas.top/data/catalog.schema.json",
  "title": "GPU Atlas paginated catalog",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "total",
    "page",
    "limit",
    "pages",
    "previous",
    "next",
    "items"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "page": {
      "type": "integer",
      "minimum": 1
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "pages": {
      "type": "integer",
      "minimum": 1
    },
    "previous": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "next": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "id",
          "url",
          "title",
          "summary",
          "language",
          "category",
          "topics",
          "published_at",
          "modified_at",
          "evidence",
          "representations"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "id": {
            "type": "string",
            "pattern": "^T-[a-f0-9]{12}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "language": {
            "const": "zh-Hans"
          },
          "category": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "url"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^c-[0-9]+$"
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "topics": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "kind",
                "url"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^(gpu|model|framework|task)-[a-f0-9]{10}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "kind": {
                  "enum": [
                    "gpu",
                    "model",
                    "framework",
                    "task"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "modified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "hardware_tested",
              "note"
            ],
            "properties": {
              "type": {
                "const": "documentation_and_conditional_estimates"
              },
              "hardware_tested": {
                "const": false
              },
              "note": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "representations": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "html",
              "json",
              "markdown"
            ],
            "properties": {
              "html": {
                "type": "string",
                "format": "uri"
              },
              "json": {
                "type": "string",
                "format": "uri"
              },
              "markdown": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}
