| 70 | } |
| 71 | |
| 72 | Json::Value resolvePossibleRef(Json::Value const &input, |
| 73 | bool stringAcceptableResult, |
| 74 | std::vector<std::string> const &searchPath) { |
| 75 | Json::Value ret{Json::nullValue}; |
| 76 | if (input.isString()) { |
| 77 | ret = loadFromFile(input.asString(), searchPath); |
| 78 | if (ret.isNull() && stringAcceptableResult) { |
| 79 | ret = input; |
| 80 | } |
| 81 | return ret; |
| 82 | } |
| 83 | if (input.isObject() && input.isMember("$ref")) { |
| 84 | /// @todo remove things after the filename in the ref. |
| 85 | ret = loadFromFile(input["$ref"].asString(), searchPath); |
| 86 | if (!ret.isNull()) { |
| 87 | return ret; |
| 88 | } |
| 89 | } |
| 90 | ret = input; |
| 91 | return ret; |
| 92 | } |
| 93 | } // namespace server |
| 94 | } // namespace osvr |
no test coverage detected