{
  "swagger": "2.0",
  "info": {
    "version": "1.0.3",
    "title": "Proxima DB API",
    "description": "Documentation for the http/https server for Proxima Database"
  },
  "host": "localhost:80",
  "basePath": "/",
  "tags": [],
  "schemes": [
    "http",
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [],
        "description": "",
        "parameters": [],
        "responses": {
          "200": {
            "schema": {
              "$ref": "#/definitions/Database"
            },
            "description": "Database Node information."
          }
        }
      },
      "post": {
        "tags": [],
        "description": "",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Database updated successfully.",
            "schema": {
              "$ref": "#/definitions/Database"
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [],
        "description": "",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}": {
      "get": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Collection retrieval issue.",
            "schema": {
              "$ref": "#/definitions/Collection"
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections": {
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/collections/{id}/documents/{docId}": {
      "get": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "docId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "docId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "docId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "value": {
                  "example": "any"
                },
                "prove": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/documents": {
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "key": {
                  "example": "any"
                },
                "value": {
                  "example": "any"
                },
                "prove": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/documents/bulkInsert": {
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "entries": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/query": {
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "obj",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "query": {
                  "example": "any"
                },
                "limit": {
                  "example": "any"
                },
                "prove": {
                  "example": "any"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/streams/{streamId}": {
      "put": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "streamId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/streams/{messageId}": {
      "get": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/streams/{streamId}/commits/{commitId}": {
      "get": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "streamId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "commitId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/collections/{id}/streams/{streamId}/commits": {
      "post": {
        "tags": [],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "streamId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "definitions": {
    "Database": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Collection-1-id"
        },
        "version": {
          "type": "string",
          "example": "0.0.0"
        },
        "name": {
          "type": "string",
          "example": "Test Collection"
        },
        "collections": {
          "type": "array",
          "example": [],
          "items": {}
        }
      }
    },
    "Collection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Collection-1-id"
        },
        "state": {
          "type": "object",
          "properties": {
            "version": {
              "type": "string",
              "example": "0.0.0"
            },
            "name": {
              "type": "string",
              "example": "Test Collection"
            },
            "controllers": {
              "type": "array",
              "example": [
                "Public Key"
              ],
              "items": {
                "type": "string"
              }
            },
            "latest_commit": {
              "type": "string",
              "example": "Commit id"
            },
            "schema": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "offset": {
              "type": "number",
              "example": 0
            }
          }
        }
      }
    },
    "AddCollection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Collection-1-id"
        },
        "meta": {
          "type": "object",
          "properties": {
            "schema": {
              "type": "string",
              "example": "schema-id"
            },
            "controllers": {
              "type": "array",
              "example": [
                "Public Key"
              ],
              "items": {
                "type": "string"
              }
            },
            "version": {
              "type": "string",
              "example": "0.0.0"
            }
          }
        }
      }
    },
    "Document": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Document 1 id"
        },
        "value": {
          "type": "string",
          "example": "Document Value"
        }
      }
    },
    "AddDocument": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "example": "Document 1 id"
        },
        "value": {
          "type": "string",
          "example": "Value"
        }
      }
    },
    "Stream": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Stream-ud"
        },
        "state": {
          "type": "object",
          "properties": {
            "version": {
              "type": "string",
              "example": "0.0.0"
            },
            "controllers": {
              "type": "array",
              "example": [
                "Public Key"
              ],
              "items": {
                "type": "string"
              }
            },
            "latest_commit": {
              "type": "string",
              "example": "Commit id"
            },
            "schema": {
              "type": "string",
              "example": "schema-id"
            },
            "offset": {
              "type": "number",
              "example": 0
            }
          }
        }
      }
    },
    "Commit": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Commit-id"
        },
        "state": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "example": "Genesis"
            },
            "version": {
              "type": "string",
              "example": "0.0.0"
            },
            "stream_id": {
              "type": "string",
              "example": "stream-id"
            },
            "commit_link": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "data": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "commit_prev": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "signature": {
              "type": "object",
              "properties": {}
            }
          }
        }
      }
    },
    "AddCommit": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "Commit-id"
        },
        "state": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "example": "Genesis"
            },
            "version": {
              "type": "string",
              "example": "0.0.0"
            },
            "stream_id": {
              "type": "string",
              "example": "stream-id"
            },
            "schema": {
              "type": "string",
              "example": "schema-id"
            },
            "commit_link": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "data": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "commit_prev": {
              "type": "array",
              "example": [],
              "items": {}
            },
            "signature": {
              "type": "object",
              "properties": {}
            }
          }
        }
      }
    },
    "Schema": {
      "type": "object",
      "properties": {
        "schema": {
          "type": "string",
          "example": "https://json-schema.org/draft/2020-12/schema"
        },
        "title": {
          "type": "string",
          "example": "Schema"
        },
        "description": {
          "type": "string",
          "example": "A schema object"
        },
        "type": {
          "type": "string",
          "example": "object"
        },
        "properties": {
          "type": "object",
          "properties": {}
        },
        "required": {
          "type": "array",
          "example": [],
          "items": {}
        },
        "tags": {
          "type": "array",
          "example": [],
          "items": {}
        }
      },
      "required": [
        "schema"
      ]
    },
    "DID": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "did:example:123456789abcdefghi"
        },
        "authentication": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "did:example:123456789abcdefghi#keys-1"
              },
              "type": {
                "type": "string",
                "example": "Ed25519VerificationKey2020"
              },
              "controller": {
                "type": "string",
                "example": "did:example:123456789abcdefghi"
              },
              "publicKeyMultibase": {
                "type": "string",
                "example": "zH3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
              }
            }
          }
        }
      }
    }
  }
}