aboutsummaryrefslogtreecommitdiff
path: root/src/server_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server_internal.h')
-rw-r--r--src/server_internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server_internal.h b/src/server_internal.h
index 9aaa5d8..9de8ca8 100644
--- a/src/server_internal.h
+++ b/src/server_internal.h
@@ -21,6 +21,7 @@
#include "deps/ae/ae.h"
+#include <cjson/cJSON.h>
#include <pthread.h>
#include <stdbool.h>
#include <stddef.h>
@@ -233,4 +234,17 @@ struct job {
job *next;
};
+/* ---- server_json.c: request validation and error bodies ---- */
+void append_json_string(sbuf *b, const char *s);
+char *json_error_body(const char *message, const char *type, size_t *len);
+void job_set_error(job *j, int status, const char *message, const char *type);
+bool ve_add(cJSON *detail, const char *loc_json, const char *msg, const char *type);
+void job_set_422(job *j, cJSON *detail);
+cJSON *parse_json_body(job *j, cJSON *detail);
+bool cjson_is_integer(cJSON *item);
+const char *encoding_from_root(cJSON *root, cJSON *detail, embedding_api_t api);
+int text_type_is_query(cJSON *root, cJSON *detail, const char *query_instruct);
+int dimensions_from_root(
+ cJSON *root, cJSON *detail, int min_dim, int max_dim, const char *encoding);
+
#endif /* EMBED_SERVER_INTERNAL_H */