Skip to content

Commit

Permalink
Support empty inputs / outputs in c++
Browse files Browse the repository at this point in the history
  • Loading branch information
linusseelinger committed Nov 21, 2023
1 parent 6b1056e commit 5dbc08d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/umbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ namespace umbridge {
json request_body;
request_body["name"] = name;

request_body["input"] = json::parse("[]");
for (std::size_t i = 0; i < inputs.size(); i++) {
request_body["input"][i] = inputs[i];
}
Expand Down Expand Up @@ -405,7 +406,6 @@ namespace umbridge {

void log_request(const httplib::Request& req, const httplib::Response& res) {
std::cout << "Incoming request from: " << req.remote_addr << " | Type: " << req.method << " " << req.path << " -> " << res.status << std::endl;

}

// Get model from name
Expand Down Expand Up @@ -468,6 +468,7 @@ namespace umbridge {
return;

json response_body;
response_body["output"] = json::parse("[]");
for (std::size_t i = 0; i < outputs.size(); i++) {
response_body["output"][i] = outputs[i];
}
Expand Down

0 comments on commit 5dbc08d

Please sign in to comment.