{
  "swagger": "2.0",
  "info": {
    "title": "Invicti gRPC Task API",
    "version": "1.0.0",
    "description": "HTTP/JSON facade transcoded by Envoy to the same Java gRPC services."
  },
  "schemes": ["https"],
  "host": "202.10.37.139:8100",
  "basePath": "/",
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "paths": {
    "/api/v1/auth/login": {
      "post": {
        "operationId": "AuthService_Login",
        "summary": "Exchange demo credentials for a bearer token",
        "parameters": [{"in": "body", "name": "body", "required": true, "schema": {"$ref": "#/definitions/invicti.v1LoginRequest"}}],
        "responses": {
          "200": {"description": "Login response", "schema": {"$ref": "#/definitions/invicti.v1LoginResponse"}},
          "400": {"description": "Invalid request"},
          "401": {"description": "Invalid username or password"}
        },
        "tags": ["AuthService"]
      }
    },
    "/api/v1/tasks": {
      "get": {
        "operationId": "TaskService_ListTasks",
        "summary": "List tasks owned by the authenticated user",
        "security": [{"BearerAuth": []}],
        "responses": {"200": {"description": "Tasks", "schema": {"$ref": "#/definitions/invicti.v1ListTasksResponse"}}, "401": {"description": "Authentication required"}},
        "tags": ["TaskService"]
      },
      "post": {
        "operationId": "TaskService_CreateTask",
        "summary": "Create a task for the authenticated user",
        "security": [{"BearerAuth": []}],
        "parameters": [{"in": "body", "name": "body", "required": true, "schema": {"$ref": "#/definitions/invicti.v1CreateTaskRequest"}}],
        "responses": {"200": {"description": "Created task", "schema": {"$ref": "#/definitions/invicti.v1Task"}}, "400": {"description": "Invalid input"}, "401": {"description": "Authentication required"}},
        "tags": ["TaskService"]
      }
    },
    "/api/v1/tasks/{task_id}": {
      "get": {
        "operationId": "TaskService_GetTask",
        "summary": "Get an owned task by ID",
        "security": [{"BearerAuth": []}],
        "parameters": [{"in": "path", "name": "task_id", "required": true, "type": "string"}],
        "responses": {"200": {"description": "Task", "schema": {"$ref": "#/definitions/invicti.v1Task"}}, "401": {"description": "Authentication required"}, "404": {"description": "Task not found"}},
        "tags": ["TaskService"]
      }
    }
  },
  "definitions": {
    "invicti.v1LoginRequest": {"type": "object", "required": ["username", "password"], "properties": {"username": {"type": "string"}, "password": {"type": "string", "format": "password"}}},
    "invicti.v1LoginResponse": {"type": "object", "properties": {"token": {"type": "string"}, "expiresIn": {"type": "string", "format": "int64"}, "tokenType": {"type": "string"}}},
    "invicti.v1CreateTaskRequest": {"type": "object", "required": ["title"], "properties": {"title": {"type": "string", "maxLength": 200}, "description": {"type": "string", "maxLength": 2000}}},
    "invicti.v1Task": {"type": "object", "properties": {"taskId": {"type": "string", "format": "int64"}, "ownerId": {"type": "string", "format": "int64"}, "title": {"type": "string"}, "description": {"type": "string"}, "status": {"type": "string"}}},
    "invicti.v1ListTasksResponse": {"type": "object", "properties": {"tasks": {"type": "array", "items": {"$ref": "#/definitions/invicti.v1Task"}}}}
  },
  "securityDefinitions": {"BearerAuth": {"type": "apiKey", "name": "Authorization", "in": "header", "description": "Use `Bearer <token>` returned by POST /api/v1/auth/login."}}
}
