{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Badge",
  "$id": "https://velocitynetwork.foundation/schemas/open-badge-v1.0",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "@context": {
      "$ref": "#/definitions/Json-ld-context_Schema"
    },
    "type": {
      "type": "string",
      "default": "Badge"
    },
    "hasCredential": {
      "type": "object",
      "required": [
        "type",
        "name",
        "description",
        "image",
        "criteria",
        "issuer"
      ],
      "properties": {
        "@context": {
          "oneOf": [
            {
              "type": "string",
              "default": "https://openbadgespec.org/v1/context.json"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "type": {
          "oneOf": [
            {
              "type": "string",
              "default": "BadgeClass",
              "maxLength": 64
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "maxLength": 64
              }
            }
          ],
          "description": "valid JSON-LD representation of the BadgeClass type. In most cases, this will simply be the string BadgeClass. An array including BadgeClass and other string elements that are either URLs or compact IRIs within the current context are allowed."
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "Unique IRI for the BadgeClass. Most platforms to date can only handle HTTP-based IRIs. Issuers using signed assertions are encouraged to publish BadgeClasses using HTTP IRIs but may instead use ephemeral BadgeClasses that use an id in another scheme such as urn:uuid.",
          "maxLength": 2048
        },
        "name": {
          "type": "string",
          "maxLength": 128,
          "description": "The name of the achievement."
        },
        "description": {
          "type": "string",
          "maxLength": 2048,
          "description": "A short description of the achievement."
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "IRI or document representing an image of the achievement. This must be a PNG or SVG image.",
          "maxLength": 2048
        },
        "criteria": {
          "type": "string",
          "description": "https://example.org/robotics-badge.html",
          "format": "uri",
          "maxLength": 2048
        },
        "issuer": {
          "type": "string",
          "format": "uri",
          "description": "The organization that issued the badge. On Velocity Network this should be DID",
          "maxLength": 2048
        },
        "alignment": {
          "type": "array",
          "description": "An array of objects describing which objectives or educational standards this badge aligns to, if any.",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/Alignment_Schema"
          }
        },
        "tags": {
          "type": "array",
          "description": "Tags that describes the type of achievement.",
          "minItems": 1,
          "items": {
            "type": "string",
            "maxLength": 64
          }
        }
      }
    }
  },
  "required": [
    "hasCredential"
  ],
  "definitions": {
    "Json-ld-context_Schema": {
      "title": "json-ld-context",
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "maxLength": 2048
          }
        }
      ],
      "description": "Simplified context for Velocity Publishers to Use"
    },
    "Alignment_Schema": {
      "title": "Alignment",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "default": "AlignmentObject"
        },
        "targetName": {
          "type": "string",
          "description": "Name of the target alignment.",
          "maxLength": 256
        },
        "targetUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the target alignment. ",
          "maxLength": 2048
        },
        "targetDescription": {
          "type": "string",
          "description": "Detailed description of the target alignment. ",
          "maxLength": 2048
        },
        "targetCode": {
          "type": "string",
          "description": "Code of the target alignment. ",
          "maxLength": 256
        },
        "targetFramework": {
          "type": "string",
          "description": "The framework to which the target belongs. ",
          "maxLength": 256
        }
      },
      "required": [
        "targetName",
        "targetUrl"
      ]
    }
  }
}