| 43 | { |
| 44 | |
| 45 | std::vector<std::string> toStrings(const nlohmann::json& value) |
| 46 | { |
| 47 | std::vector<std::string> result; |
| 48 | if (value.is_string()) |
| 49 | { |
| 50 | result.push_back(value.get<std::string>()); |
| 51 | return result; |
| 52 | } |
| 53 | else if (value.is_array()) |
| 54 | { |
| 55 | for (size_t i = 0; i < value.size(); ++i) |
| 56 | { |
| 57 | if (value[i].is_string()) |
| 58 | result.push_back(value[i].get<std::string>()); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return result; |
| 63 | } |
| 64 | |
| 65 | } // namespace |
| 66 |
no test coverage detected