{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "members",
    "description": "Base members definitions",
    "definitions": {
        "member": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string",
                    "maxLength": 191,
                    "pattern": "^([^,]|$)"
                },
                "email": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 191,
                    "pattern": "^([^,]|$)"
                },
                "avatar_image": {
                    "strip": true
                },
                "note": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 2000
                },
                "subscribed": {
                    "type": "boolean"
                },
                "comped": {
                    "strip": "true"
                },
                "id": {
                    "strip": true
                },
                "labels": {
                    "$ref": "#/definitions/member-labels"
                },
                "created_at": {
                    "strip": true
                },
                "created_by": {
                    "strip": true
                },
                "updated_at": {
                    "strip": true
                },
                "updated_by": {
                    "strip": true
                }
            }
        },
        "member-labels": {
            "description": "Labels of the member",
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "maxLength": 24
                            },
                            "name": {
                                "type": "string",
                                "maxLength": 191
                            },
                            "slug": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "maxLength": 191
                            },
                            "members": {
                                "strip": true
                            }
                        },
                        "anyOf": [
                            {
                                "required": [
                                    "id"
                                ]
                            },
                            {
                                "required": [
                                    "name"
                                ]
                            },
                            {
                                "required": [
                                    "slug"
                                ]
                            }
                        ]
                    },
                    {
                        "type": "string",
                        "maxLength": 191
                    }
                ]
            }
        }
    },
    "properties": {
        "member": {
            "$ref": "#/definitions/member"
        },
        "member-labels": {
            "$ref": "#/definitions/member-labels"
        }
    },
    "required": [
        "member",
        "member-labels"
    ]
}