Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Check meta data format in json map (#4461)

Kevin Huc08382099a6e
diff --git a/api/apps/document_app.py b/api/apps/document_app.py
index 81bf1ec3c0..21aff7dd6a 100644
--- a/api/apps/document_app.py
+++ b/api/apps/document_app.py
@@ -612,6 +612,10 @@ def set_meta():
except Exception as e:
return get_json_result(
data=False, message=f'Json syntax error: {e}', code=settings.RetCode.ARGUMENT_ERROR)
+ if not isinstance(meta, dict):
+ return get_json_result(
+ data=False, message='Meta data should be in Json map format, like {"key": "value"}', code=settings.RetCode.ARGUMENT_ERROR)
+
try:
e, doc = DocumentService.get_by_id(req["doc_id"])
if not e: