Skip to content

Commit

Permalink
fix yaml node parsing
Browse files Browse the repository at this point in the history
Committed-by: xiaolei.zl from Dev container
  • Loading branch information
zhanglei1949 committed Dec 19, 2024
1 parent 4265ca5 commit 016c16d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flex/utils/yaml_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ void convert_yaml_node_to_json(const YAML::Node& node,
json.SetInt(node.as<int>());
} catch (const YAML::BadConversion& e) {
try {
json.SetDouble(node.as<double>());
json.SetInt64(node.as<int64_t>());
} catch (const YAML::BadConversion& e) {
try {
json.SetBool(node.as<bool>());
json.SetDouble(node.as<double>());
} catch (const YAML::BadConversion& e) {
json.SetString(node.as<std::string>().c_str(), allocator);
try {
json.SetBool(node.as<bool>());
} catch (const YAML::BadConversion& e) {
json.SetString(node.as<std::string>().c_str(), allocator);
}
}
}
}
Expand Down

0 comments on commit 016c16d

Please sign in to comment.