{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://0xcopy.github.io/models-metadata/schemas/listing.v0.json",
  "title": "Models listing extension v0 (proposal)",
  "description": "One model object in a models listing (for example an item of GET /v1/models). Native members stay the vendor's own. The only addition is describedby: content descriptors for the documents that describe this model. See spec/profile.md.",
  "type": "object",
  "properties": {
    "describedby": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/descriptor"
      }
    }
  },
  "$defs": {
    "descriptor": {
      "description": "An OCI content descriptor (opencontainers/image-spec descriptor.md), used as-is.",
      "type": "object",
      "required": [
        "mediaType",
        "digest",
        "size"
      ],
      "properties": {
        "mediaType": {
          "type": "string"
        },
        "artifactType": {
          "type": "string"
        },
        "digest": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:[+._-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "urls": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "data": {
          "type": "string",
          "contentEncoding": "base64"
        },
        "annotations": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  }
}
