From d0713e15f18ff8b7ea7223cd03491cf00c630ddc Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Mon, 22 Jul 2024 15:21:32 -0700
Subject: [PATCH] patch response body for swagger

---
 server/endpoints/api/document/index.js |  2 +-
 server/swagger/openapi.json            | 22 +++++++++++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/server/endpoints/api/document/index.js b/server/endpoints/api/document/index.js
index 7c682d402..51b2c03de 100644
--- a/server/endpoints/api/document/index.js
+++ b/server/endpoints/api/document/index.js
@@ -237,7 +237,7 @@ function apiDocumentEndpoints(app) {
             example: {
               "textContent": "This is the raw text that will be saved as a document in AnythingLLM.",
               "metadata": {
-                "title": "This key is required. See in /server/endpoints/api/document/index.js:287"
+                "title": "This key is required. See in /server/endpoints/api/document/index.js:287",
                 keyOne: "valueOne",
                 keyTwo: "valueTwo",
                 etc: "etc"
diff --git a/server/swagger/openapi.json b/server/swagger/openapi.json
index 37f363a2b..7831bd55e 100644
--- a/server/swagger/openapi.json
+++ b/server/swagger/openapi.json
@@ -1012,7 +1012,27 @@
             "description": "Internal Server Error"
           }
         },
-        "requestBody": {}
+        "requestBody": {
+          "description": "Text content and metadata of the file to be saved to the system. Use metadata-schema endpoint to get the possible metadata keys",
+          "required": true,
+          "type": "object",
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "example": {
+                  "textContent": "This is the raw text that will be saved as a document in AnythingLLM.",
+                  "metadata": {
+                    "title": "This key is required. See in /server/endpoints/api/document/index.js:287",
+                    "keyOne": "valueOne",
+                    "keyTwo": "valueTwo",
+                    "etc": "etc"
+                  }
+                }
+              }
+            }
+          }
+        }
       }
     },
     "/v1/documents": {
-- 
GitLab