{
  "openapi": "3.0.1",
  "info": {
    "title": "SealCI",
    "description": "A Rust Continuous Integration Framework",
    "version": "0.0.1"
  },
  "tags": [],
  "paths": {
    "/pipeline": {
      "post": {
        "summary": "Create a pipeline",
        "deprecated": false,
        "description": "",
        "tags": [],
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "repo_url": {
                    "description": "URL of the repository containing the pipeline manifest. It is used to checkout the repository.",
                    "example": "https://github.com/dev-sys-do/sealci",
                    "type": "string"
                  },
                  "body": {
                    "format": "binary",
                    "type": "string",
                    "description": "Manifest defining your pipeline and its actions.",
                    "example": "https://gist.github.com/Courtcircuits/31a2843c790965f2148ff54a867323a4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "422": {
            "description": "Parameter Error",
            "content": {
              "application/json": {
                "schema": {
                  "title": "",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "examples": {
                  "1": {
                    "summary": "Manifest error",
                    "value": {
                      "message": "Couldn't parsed manifest. Error at line 32 ..."
                    }
                  },
                  "2": {
                    "summary": "Bad format for name",
                    "value": {
                      "message": "Name contains non UTF-8 characters."
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      },
      "get": {
        "summary": "List all pipelines",
        "deprecated": false,
        "description": "List all pipelines and optionally details about the actions.",
        "tags": [],
        "parameters": [
          {
            "name": "verbose",
            "in": "query",
            "description": "",
            "required": false,
            "example": "Show actions details",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/pipeline",
                    "description": "All pipelines belonging to the user/project"
                  },
                  "title": "pipelines"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/pipelines/{id}": {
      "get": {
        "summary": "Get a pipeline status",
        "deprecated": false,
        "description": "Get a pipeline and all its actions status.",
        "tags": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verbose",
            "in": "query",
            "description": "",
            "required": false,
            "example": "Show actions details",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/pipeline",
                  "description": "All pipelines belonging to the user/project"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "action": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID"
          },
          "name": {
            "type": "string",
            "description": "name"
          },
          "status": {
            "type": "string"
          },
          "payload": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "payload"
        ]
      },
      "pipeline": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID"
          },
          "name": {
            "type": "string",
            "description": "Display name for the pipeline"
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/action"
            },
            "description": "Actions related to this pipeline",
            "title": "actions"
          }
        },
        "required": [
          "id",
          "name"
        ]
      }
    },
    "securitySchemes": {}
  },
  "servers": []
}