{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schema.twindev.org/w3c-did/DidDocument",
    "title": "DidDocument",
    "description": "Interface describing a DID Document.\nSpec https://www.w3.org/TR/did-core/#did-document-properties.",
    "type": "object",
    "properties": {
        "@context": {
            "anyOf": [
                {
                    "const": "https://www.w3.org/ns/did/v1"
                },
                {
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
                            },
                            {
                                "const": "https://www.w3.org/ns/did/v1"
                            }
                        ]
                    },
                    "contains": {
                        "const": "https://www.w3.org/ns/did/v1"
                    },
                    "minContains": 1,
                    "maxContains": 1,
                    "minItems": 1
                }
            ],
            "description": "The context for the document."
        },
        "id": {
            "type": "string",
            "description": "The id for the document."
        },
        "alsoKnownAs": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            ],
            "description": "Aliases for the document."
        },
        "controller": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            ],
            "description": "The controller for the document."
        },
        "verificationMethod": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The verification methods."
        },
        "authentication": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The authentication methods."
        },
        "assertionMethod": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The assertion methods."
        },
        "keyAgreement": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The key agreements."
        },
        "capabilityInvocation": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The capability invocations."
        },
        "capabilityDelegation": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "string"
                    },
                    {
                        "$ref": "https://schema.twindev.org/w3c-did/DidDocumentVerificationMethod"
                    }
                ]
            },
            "description": "The capability delegations."
        },
        "service": {
            "type": "array",
            "items": {
                "$ref": "https://schema.twindev.org/w3c-did/DidService"
            },
            "description": "The services."
        }
    },
    "required": [
        "@context",
        "id"
    ]
}
