{
  "openapi": "3.1.0",
  "info": {
    "title": "Cedar Parcel API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sandbox.api.cedar-parcel.example/v1",
      "description": "Sandbox"
    },
    {
      "url": "https://api.cedar-parcel.example/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ServiceBearer": []
    },
    {
      "ParcelKey": []
    }
  ],
  "tags": [
    {
      "name": "Manifests",
      "description": "Upload dispatch files."
    }
  ],
  "paths": {
    "/manifests": {
      "post": {
        "tags": [
          "Manifests"
        ],
        "summary": "Upload a manifest",
        "operationId": "uploadManifest",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "manifest",
                  "checksum"
                ],
                "properties": {
                  "manifest": {
                    "type": "string",
                    "format": "binary",
                    "description": "Dispatch data file."
                  },
                  "checksum": {
                    "type": "string",
                    "format": "binary",
                    "description": "Separate checksum file."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Upload accepted for validation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobId",
                    "status"
                  ],
                  "properties": {
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "validating"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ParcelKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Parcel-Key",
        "description": "Long-lived account key."
      },
      "ServiceBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived service token."
      }
    }
  }
}
