json-schema-validator/test/utils.h
Cristian Le cadf5cc226 Migrate tests to Catch2
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-11-28 15:08:28 +01:00

21 lines
794 B
C++

#pragma once
#include <filesystem>
#include <string>
#include <nlohmann/json-schema.hpp>
class JsonValidateFixture
{
nlohmann::json_schema::json_validator validator;
public:
JsonValidateFixture();
nlohmann::json validate(std::string_view schema_path, std::string_view instance_path);
nlohmann::json validate(const std::filesystem::path &schema_path, std::string_view instance_path);
nlohmann::json validate(const std::filesystem::path &schema_path, const std::filesystem::path &instance_path);
nlohmann::json validate(const std::filesystem::path &schema_path, const nlohmann::json &instance);
nlohmann::json validate(const nlohmann::json &schema, const std::filesystem::path &instance_path);
nlohmann::json validate(const nlohmann::json &schema, const nlohmann::json &instance);
};