Skip to content

update json #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ modelbox::Status RestfulSourceParser::GetRestfulInfo(

if (config_json.contains("headers")) {
auto value = config_json["headers"].get<nlohmann::json>();
for (auto &header : value.items()) {
for (const auto &header : value.items()) {
if (header.key().empty()) {
MBLOG_ERROR << "headers key is empty!";
return modelbox::STATUS_BADCONF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ modelbox::Status WebhookOutputBroker::ParseConfig(
MBLOG_DEBUG << "url: " << output_info->url;

auto value = json["headers"].get<nlohmann::json>();
for (auto &header : value.items()) {
for (const auto &header : value.items()) {
if (header.key().empty()) {
MBLOG_ERROR << "headers key is empty!";
return modelbox::STATUS_BADCONF;
Expand Down
4 changes: 2 additions & 2 deletions src/modelbox/server/plugin/editor/editor_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ void ModelboxEditorPlugin::HandlerGraphModifyTime(
modelbox::Status ModelboxEditorPlugin::GenerateCommandFromJson(
const nlohmann::json& body, std::string& cmd) {
nlohmann::json error_json;
for (auto& element : body.items()) {
for (const auto& element : body.items()) {
cmd += " -" + element.key();
if (element.value().is_null()) {
continue;
Expand All @@ -548,7 +548,7 @@ modelbox::Status ModelboxEditorPlugin::GenerateCommandFromJson(
cmd += " ";
}

for (auto& i : port.items()) {
for (const auto& i : port.items()) {
cmd += i.key() + "=" + i.value().dump();
if (i != port.items().end()) {
cmd += ",";
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/CMake/local-package.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ExternalProject_Add(
# nlohmann json
ExternalProject_Add(
nlohmann
URL @LOCAL_PACKAGE_PATH@/v3.7.3.tar.gz
URL @LOCAL_PACKAGE_PATH@/v3.11.2.tar.gz
SOURCE_DIR ${THIRDPARTY_DOWNLOAD_DIR}/nlohmann
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/CMake/pre-download.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (NOT @USE_CN_MIRROR@)
set(TINYLOG_DOWNLOAD_URL "https://github.com/pymumu/tinylog/archive/refs/tags/v1.6.zip")
set(PYBIND11_DOWNLOAD_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.9.1.zip")
set(TOML11_DOWNLOAD_URL "https://github.com/ToruNiina/toml11/archive/refs/tags/v3.7.1.zip")
set(NLOHMANN_DOWNLOAD_URL "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip")
set(NLOHMANN_DOWNLOAD_URL "https://github.com/nlohmann/json/releases/download/v3.11.2/include.zip")
set(CPP_HTTPLIB_DOWNLOAD_URL "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.10.4.zip")
set(APIGW_CPP_SDK_DOWNLOAD_URL "https://github.com/modelbox-ai/modelbox-binary/releases/download/BinaryArchive/APIGW-cpp-sdk.zip")
set(MODELBOX_WEBUI_DOWNLOAD_URL "https://github.com/modelbox-ai/modelbox-webui/archive/refs/tags/0.1.3.zip")
Expand All @@ -44,7 +44,7 @@ else()
set(TINYLOG_DOWNLOAD_URL "https://ghproxy.com/github.com/pymumu/tinylog/archive/refs/tags/v1.6.zip")
set(PYBIND11_DOWNLOAD_URL "https://gitcode.net/mirrors/pybind/pybind11/-/archive/v2.9.1/pybind11-v2.9.1.zip")
set(TOML11_DOWNLOAD_URL "https://ghproxy.com/github.com/ToruNiina/toml11/archive/refs/tags/v3.7.1.zip")
set(NLOHMANN_DOWNLOAD_URL "https://gitcode.net/mirrors/nlohmann/json/-/archive/v3.7.3/json-v3.7.3.zip")
set(NLOHMANN_DOWNLOAD_URL "https://gitcode.net/mirrors/nlohmann/json/-/archive/v3.7.3/json-v3.11.2.zip")
set(CPP_HTTPLIB_DOWNLOAD_URL "https://gitcode.net/mirrors/yhirose/cpp-httplib/-/archive/v0.10.4/cpp-httplib-v0.10.4.zip")
set(APIGW_CPP_SDK_DOWNLOAD_URL "https://obs.cn-north-1.myhuaweicloud.com/apig-sdk/APIGW-cpp-sdk.zip")
set(MODELBOX_WEBUI_DOWNLOAD_URL "https://gitee.com/modelbox/modelbox-webui/repository/archive/tags/0.1.3.zip")
Expand Down