| 226 | } |
| 227 | |
| 228 | void Catalog::validate() |
| 229 | { |
| 230 | nlohmann::json_schema::json_validator val( |
| 231 | [this](const nlohmann::json_uri& json_uri, nlohmann::json& json) { |
| 232 | json = m_connector.getJson(json_uri.url()); |
| 233 | }, |
| 234 | [](const std::string &, const std::string &) {} |
| 235 | ); |
| 236 | |
| 237 | NL::json schemaJson = m_connector.getJson(m_schemaUrls.catalog); |
| 238 | val.set_root_schema(schemaJson); |
| 239 | try { |
| 240 | val.validate(m_json); |
| 241 | } |
| 242 | catch (std::exception& e) |
| 243 | { |
| 244 | throw stac_error(m_id, "catalog", |
| 245 | "STAC schema validation Error in root schema: " + |
| 246 | m_schemaUrls.catalog + ". \n\n" + e.what()); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | //if catalog matches filter requirements, return true |
| 251 | bool Catalog::filter(Filters filters) { |
nothing calls this directly
no test coverage detected