{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://directdemocracy.vote/json-schema/2/citizen.schema.json",
  "title": "citizen",
  "description": "information allowing to identify uniquely a citizen",
  "type": "object",
  "required": [
    "schema",
    "key",
    "signature",
    "published",
    "appKey",
    "appSignature",
    "givenNames",
    "familyName",
    "locality",
    "picture"
  ],
  "properties": {
    "schema": {
      "const": "https://directdemocracy.vote/json-schema/2/citizen.schema.json"
    },
    "key": {
      "description": "public key of the citizen",
      "type": "string",
      "maxLength": 512
    },
    "signature": {
      "description": "signature of the citizen",
      "type": "string",
      "maxLength": 512
    },
    "published": {
      "description": "date of publication (seconds since 1970-01-01 00:00:00)",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999
    },
    "appKey": {
      "description": "public key of the app used by the citizen",
      "type": "string",
      "maxLength": 512
    },
    "appSignature": {
      "description": "signature of the app",
      "type": "string",
      "maxLength": 512
    },
    "givenNames": {
      "description": "first name and possibly middle name of the citizen",
      "type": "string",
      "maxLength": 256,
      "minLength": 1
    },
    "familyName": {
      "description": "last name of the citizen",
      "type": "string",
      "maxLength": 256,
      "minLength": 1
    },
    "locality": {
      "description": "OSM id of the relation corresponding to the locality of the citizen",
      "type": "integer"
    },
    "picture": {
      "description": "portrait ID photo of the citizen with a resolution of 150x200 pixels",
      "type": "string",
      "contentMediaType": "image/jpeg",
      "contentEncoding": "base64",
      "maxLength": 32768
    }
  },
  "additionalProperties": false
}
