{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://mapeo.world/schemas/common/v1.json",
  "title": "Common",
  "description": "These properties are shared by all objects in the Mapeo database.",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique value that identifies this element",
      "type": "string"
    },
    "version": {
      "description": "Unique value that identifies this particular version of this element",
      "type": "string"
    },
    "created_at": {
      "description": "RFC3339-formatted datetime of when the first version of the element was created",
      "type": "string",
      "format": "date-time"
    },
    "timestamp": {
      "description": "RFC3339-formatted datetime of when this version of the element was created",
      "type": "string",
      "format": "date-time"
    },
    "userId": {
      "description": "ID of the user who made this edit",
      "type": "string"
    },
    "deviceId": {
      "description": "ID of the device that made this edit",
      "type": "string"
    },
    "schemaType": {
      "description": "enum that defines the type of document in the database (defines which schema should be used)",
      "type": "string"
    },
    "links": {
      "description": "Version ids of the previous document versions this one is replacing",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "schemaVersion": {
      "description": "Version of schema. Should increment for breaking changes to the schema",
      "type": "number",
      "minimum": 1
    }
  },
  "required": ["id", "created_at", "schemaType"]
}
