{
    "type": "object",
    "x-documentConfig": {
        "methods": [
            "get",
            "getList",
            "post",
            "patch"
        ],
        "documentName": "User"
    },
    "properties": {
        "_id": {
            "type": "string",
            "x-format": "ObjectId",
            "index": true
        },
        "authProfiles": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "provider": {
                        "type": "string",
                        "index": true
                    },
                    "authId": {
                        "type": "string",
                        "index": true
                    },
                    "username": {
                        "type": "string"
                    }
                },
                "required": []
            }
        },
        "email": {
            "type": "string",
            "format": "email",
            "index": true
        },
        "name": {
            "type": "string",
            "maxLength": 64,
            "required": true
        },
        "active": {
            "type": "boolean",
            "default": true,
            "required": true
        },
        "locale": {
            "type": "string",
            "maxLength": 8
        },
        "roles": {
            "type": "array",
            "x-vexData": "role",
            "items": {
                "type": "string",
                "enum": [
                    "visitor",
                    "member",
                    "admin"
                ]
            },
            "default": [
                "visitor"
            ]
        },
        "profileErrors": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "name",
        "active"
    ]
}