6#include <PhosphorFsLoader/phosphorfsloader_export.h>
8#include <QtCore/QByteArray>
9#include <QtCore/QJsonValue>
10#include <QtCore/QList>
11#include <QtCore/QString>
16class QLoggingCategory;
77 [[nodiscard]] static
SchemaValidator fromResource(const QString& resourcePath, const QLoggingCategory& category);
80 [[nodiscard]]
bool isValid() const;
90 [[nodiscard]] std::optional<QList<
Error>> validate(const QJsonValue& document) const;
94 std::unique_ptr<Private> d;
104PHOSPHORFSLOADER_EXPORT
void logSchemaErrors(const QLoggingCategory& category,
Validates parsed JSON documents against a JSON Schema (Draft 7).
Definition SchemaValidator.h:38
SchemaValidator(const QByteArray &schemaJson)
Compile a JSON Schema from its serialized bytes.
SchemaValidator(SchemaValidator &&) noexcept
Definition DirectoryLoader.h:19
A single schema violation.
Definition SchemaValidator.h:42
QString message
Human-readable description of why the node failed.
Definition SchemaValidator.h:49
QString path
JSON Pointer to the node that failed validation (e.g.
Definition SchemaValidator.h:46