{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Peer set",
    "type": "array",
    "items": {
        "title": "Peer",
        "type": "object",
        "properties": {
            "apiVersion": {
                "enum": [
                    "v1beta1",
                    "v1.0",
                    "v1"
                ]
            },
            "kind": {
                "enum": [
                    "Peer",
                    "peer"
                ],
                "readOnly": true
            },
            "metadata": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 30
                    },
                    "createdOn": {
                        "type": "string",
                        "readOnly": true
                    },
                    "modifiedOn": {
                        "type": "string",
                        "readOnly": true
                    },
                    "ref": {
                        "type": "string",
                        "readOnly": true,
                        "minLength": 3,
                        "maxLength": 24
                    }
                },
                "required": [
                    "name"
                ]
            },
            "spec": {
                "type": "object",
                "properties": {
                    "credentials": {
                        "type": "object",
                        "properties": {
                            "username": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 30
                            },
                            "secret": {
                                "type": "string",
                                "writeOnly": true
                            }
                        },
                        "required": [
                            "username",
                            "secret"
                        ]
                    },
                    "device": {
                        "type": "string",
                        "minLength": 1
                    },
                    "contactAddr": {
                        "type": "string",
                        "minLength": 1
                    }
                },
                "required": [
                    "credentials"
                ]
            }
        },
        "required": [
            "apiVersion",
            "kind",
            "spec",
            "metadata"
        ]
    }
}