{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.ishare.eu/v3/claims/dataspace-membership/schema.json",
  "title": "Verifiable Credential: iSHARE Dataspace Membership Claim",
  "description": "Verifiable Credential envelope for an iSHARE Dataspace Membership Claim. VC 2.0 fields at the top level; domain-specific claims under credentialSubject. This schema describes the unsigned VC envelope (without proof).",
  "type": "object",
  "properties": {
    "@context": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "const": "https://www.w3.org/ns/credentials/v2"
        },
        {
          "const": "https://schemas.ishare.eu/v3/claims/dataspace-membership/context.jsonld"
        }
      ]
    },
    "type": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "const": "VerifiableCredential"
        },
        {
          "const": "DataspaceMembershipCredential"
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "issuer": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": true
        }
      ]
    },
    "validFrom": {
      "type": "string",
      "format": "date-time"
    },
    "validUntil": {
      "type": "string",
      "format": "date-time"
    },
    "credentialStatus": {
      "$ref": "https://schemas.ishare.eu/v3/common/credential-status.json#/$defs/CredentialStatus",
      "description": "Credential status for checking revocation, suspension, or refresh status using bitstring status lists (BitstringStatusListEntry) as defined in W3C Bitstring Status List v1.0"
    },
    "credentialSubject": {
      "$ref": "#/$defs/DataspaceMembershipClaimSubject"
    }
  },
  "required": [
    "@context",
    "type",
    "issuer",
    "credentialStatus",
    "credentialSubject"
  ],
  "additionalProperties": false,
  "$defs": {
    "DataspaceMembershipClaimSubject": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "dataspaceMembership"
        },
        "registrarId": {
          "type": "string"
        },
        "dataspaceId": {
          "type": "string",
          "description": "Identifier of the dataspace of which the participant is a member of",
          "examples": ["DSP.EU.NL.DutchMobility"]
        },
        "legalAdherence": {
          "type": "string",
          "enum": [
            "yes",
            "no",
            "not-applicable"
          ],
          "description": "Whether legal adherence is required, not required or not applicable"
        },
        "capabilityUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL where the party's capabilities can be found"
        },
        "additionalInfo": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string"
            },
            "logo": {
              "type": "string"
            },
            "website": {
              "type": "string"
            },
            "companyPhone": {
              "type": "string"
            },
            "companyEmail": {
              "type": "string",
              "format": "email"
            },
            "publiclyPublishable": {
              "type": "boolean"
            },
            "countriesOfOperation": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "sectorIndustry": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "tags": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "registrarId",
        "dataspaceId",
        "legalAdherence"
      ],
      "additionalProperties": false
    }
  }
}
