{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://directdemocracy.vote/json-schema/2/vote.schema.json",
  "title": "vote",
  "description": "vote of a citizen to a referendum",
  "type": "object",
  "required": [
    "schema",
    "key",
    "signature",
    "published",
    "appKey",
    "appSignature",
    "referendum",
    "number",
    "area",
    "ballot",
    "answer"
  ],
  "properties": {
    "schema": {
      "const": "https://directdemocracy.vote/json-schema/2/vote.schema.json"
    },
    "key": {
      "description": "public key of the station",
      "type": "string",
      "maxLength": 512
    },
    "signature": {
      "description": "signature by the station",
      "type": "string",
      "maxLength": 512
    },
    "published": {
      "description": "current date (seconds since 1970-01-01 00:00:00)",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999
    },
    "appKey": {
      "description": "public key of the app server",
      "type": "string",
      "maxLength": 512
    },
    "appSignature": {
      "description": "signature of the app server for the referendum, ballot, number and answer",
      "type": "string",
      "maxLength": 512
    },
    "referendum": {
      "description": "signature of the referendum",
      "type": "string",
      "maxLength": 512
    },
    "number": {
      "description": "vote number, increased by a random amount each time the citizen re-vote to the same referendum",
      "type": "integer",
      "minimum": 1
    },
    "area": {
      "description": "local area number issued by the judge of the referendum",
      "type": "integer",
      "minimum": 1
    },
    "ballot": {
      "description": "unique vote number generated by the app",
      "type": "string"
    },
    "answer": {
      "description": "answer of the citizen to the referendum question",
      "type": "string"
    }
  },
  "additionalProperties": false
}
