aboutsummaryrefslogtreecommitdiffstats
path: root/src/Response.cpp
diff options
context:
space:
mode:
authorNiklas Halle <niklas@niklashalle.net>2020-08-26 11:20:44 +0200
committerNiklas Halle <niklas@niklashalle.net>2020-08-26 11:20:44 +0200
commit2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c (patch)
treebb40e187f4362333503c5cf0622575db3a46c0d4 /src/Response.cpp
parent38e20390ddf38edd74447ef7db2af660b8e0ff32 (diff)
downloadn_core-2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c.tar.gz
n_core-2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c.zip
Extended extra field of annotations to be an list of text-annotation pairs as well
Fixed CMake Boost findings
Diffstat (limited to 'src/Response.cpp')
-rw-r--r--src/Response.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Response.cpp b/src/Response.cpp
index 050a537..d7006c9 100644
--- a/src/Response.cpp
+++ b/src/Response.cpp
@@ -10,7 +10,14 @@ Response::json Response::simple_response(std::string const &text, std::string co
Response::json Response::create_annotation(Reply::AnnotationType annotationType, std::string const &extra) {
json annotation(crow::json::type::Object);
annotation["type"] = Reply::GetStringAnnotationType(annotationType);
- annotation["extra"] = extra;
+ annotation["extra"] = create_text(extra);
+ return annotation;
+}
+
+Response::json Response::create_annotation(Reply::AnnotationType annotationType, std::vector<json> &&extra) {
+ json annotation(crow::json::type::Object);
+ annotation["type"] = Reply::GetStringAnnotationType(annotationType);
+ annotation["extra"] = std::move(extra);
return annotation;
}