1#ifndef SOURCEMETA_BLAZE_ALTERSCHEMA_H_
2#define SOURCEMETA_BLAZE_ALTERSCHEMA_H_
13#ifndef SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT
14#include <sourcemeta/blaze/alterschema_export.h>
17#include <sourcemeta/blaze/alterschema_error.h>
18#include <sourcemeta/blaze/alterschema_transformer.h>
20#include <sourcemeta/blaze/compiler.h>
21#include <sourcemeta/core/jsonschema.h>
28namespace sourcemeta::blaze {
34#pragma warning(disable : 4251 4275)
78SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT
91class SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT SchemaRule final
92 :
public SchemaTransformRule {
95 enum class Scope : std::uint8_t {
103 using mutates = std::false_type;
104 using reframe_after_transform = std::false_type;
105 SchemaRule(
const sourcemeta::core::JSON &schema,
106 const sourcemeta::core::SchemaWalker &walker,
107 const sourcemeta::core::SchemaResolver &resolver,
109 const std::string_view default_dialect =
"",
110 const std::optional<Tweaks> &tweaks = std::nullopt,
111 const Scope scope = Scope::All);
112 [[nodiscard]]
auto condition(
const sourcemeta::core::JSON &,
113 const sourcemeta::core::JSON &,
114 const sourcemeta::core::SchemaVocabularies &,
115 const sourcemeta::core::SchemaFrame &,
116 const sourcemeta::core::SchemaFrame::Location &,
117 const sourcemeta::core::SchemaWalker &,
118 const sourcemeta::core::SchemaResolver &)
const
127#pragma warning(default : 4251 4275)
167SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT
168auto wrap(
const sourcemeta::core::JSON &schema,
169 const sourcemeta::core::SchemaFrame &frame,
170 const sourcemeta::core::SchemaFrame::Location &location,
171 const sourcemeta::core::SchemaWalker &walker,
172 const sourcemeta::core::SchemaResolver &resolver,
173 sourcemeta::core::WeakPointer &base) -> sourcemeta::core::JSON;
Scope
The locations of the schema that the rule applies to.
Definition alterschema.h:95
SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT auto wrap(const sourcemeta::core::JSON &schema, const sourcemeta::core::SchemaFrame &frame, const sourcemeta::core::SchemaFrame::Location &location, const sourcemeta::core::SchemaWalker &walker, const sourcemeta::core::SchemaResolver &resolver, sourcemeta::core::WeakPointer &base) -> sourcemeta::core::JSON
SOURCEMETA_BLAZE_ALTERSCHEMA_EXPORT auto add(SchemaTransformer &bundle, const AlterSchemaMode mode) -> void
AlterSchemaMode
Definition alterschema.h:39
@ Linter
Definition alterschema.h:42
std::function< Instructions(const KeywordContext &, const Instructions &)> Compiler
Definition compiler.h:105