{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://directdemocracy.vote/json-schema/2/proposal.schema.json",
  "title": "proposal",
  "description": "petition or referendum",
  "type": "object",
  "required": [
    "schema",
    "key",
    "signature",
    "published",
    "area",
    "title",
    "description",
    "type",
    "secret",
    "deadline",
    "trust"
  ],
  "properties": {
    "schema": {
      "const": "https://directdemocracy.vote/json-schema/2/proposal.schema.json"
    },
    "key": {
      "description": "public key of the judge",
      "type": "string",
      "maxLength": 512
    },
    "signature": {
      "description": "signature of the judge",
      "type": "string",
      "maxLength": 512
    },
    "published": {
      "description": "date of publication (seconds since 1970-01-01 00:00:00)",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999
    },
    "area": {
      "description": "area id published by the judge of the proposal",
      "type": "integer",
      "minimum": 0
    },
    "title": {
      "description": "title of the proposal",
      "type": "string",
      "maxLength": 128,
      "minLength": 1
    },
    "description": {
      "description": "detailed description of the proposal (markdown allowed)",
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "question": {
      "description": "question to which the citizen should answer",
      "type": "string",
      "maxLength": 128,
      "minLength": 1
    },
    "answers": {
      "description": "possible answers to the above question",
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 128,
        "minLength": 1
      }
    },
    "type": {
      "enum": ["petition", "referendum", "election"]
    },
    "secret": {
      "description": "whether the votes to the proposal should be anonymous or public",
      "type": "boolean"
    },
    "deadline": {
      "description": "date of vote deadline (seconds since 1970-01-01 00:00:00), minutes and seconds should be 0",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999,
      "multipleOf": 3600
    },
    "trust": {
      "description": "date or delay for trusted citizens, minutes and seconds should be 0",
      "type": "integer",
      "minimum": 0,
      "maximum": 999999999999,
      "multipleOf": 3600
    },
    "website": {
      "description": "website providing more information about the proposal",
      "type": "string",
      "format": "uri",
      "maxLength": 128
    }
  },
  "additionalProperties": false
}
