A set of JSON Schema utilities across dialects. More...
Typedefs | |
| using | sourcemeta::blaze::SchemaResolver = std::function< std::optional< sourcemeta::core::JSON >(std::string_view)> |
| using | sourcemeta::blaze::SchemaWalker = std::function< const SchemaWalkerResult &(std::string_view, const Vocabularies &)> |
Functions | |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::schema_resolver (const std::string_view identifier) -> std::optional< sourcemeta::core::JSON > |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::is_known_schema (const std::string_view identifier) noexcept -> bool |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::is_official_schema (const std::string_view identifier) noexcept -> bool |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::schema_walker (const std::string_view keyword, const Vocabularies &vocabularies) -> const SchemaWalkerResult & |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::to_string (const SchemaBaseDialect base_dialect) -> std::string_view |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::to_base_dialect (const std::string_view base_dialect) -> std::optional< SchemaBaseDialect > |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::schema_keyword_priority (const std::string_view keyword, const Vocabularies &vocabularies, const SchemaWalker &walker) -> std::uint64_t |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::is_schema (const sourcemeta::core::JSON &schema) -> bool |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::is_empty_schema (const sourcemeta::core::JSON &schema) -> bool |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::identify (const sourcemeta::core::JSON &schema, const SchemaResolver &resolver, std::string_view default_dialect="", std::string_view default_id="", bool allow_dialect_override=true) -> std::string_view |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::identify (const sourcemeta::core::JSON &schema, const SchemaBaseDialect base_dialect, std::string_view default_id="") -> std::string_view |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::anonymize (sourcemeta::core::JSON &schema, const SchemaBaseDialect base_dialect) -> void |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::reidentify (sourcemeta::core::JSON &schema, std::string_view new_identifier, const SchemaResolver &resolver, std::string_view default_dialect="") -> void |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::reidentify (sourcemeta::core::JSON &schema, std::string_view new_identifier, const SchemaBaseDialect base_dialect) -> void |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::dialect (const sourcemeta::core::JSON &schema, std::string_view default_dialect="", bool allow_dialect_override=true) -> std::string_view |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::metaschema_try_embedded (const sourcemeta::core::JSON &schema, std::string_view identifier, const SchemaResolver &resolver) -> const sourcemeta::core::JSON * |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::metaschema (const sourcemeta::core::JSON &schema, const SchemaResolver &resolver, std::string_view default_dialect="") -> sourcemeta::core::JSON |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::base_dialect (const sourcemeta::core::JSON &schema, const SchemaResolver &resolver, std::string_view default_dialect="", bool allow_dialect_override=true) -> std::optional< SchemaBaseDialect > |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::parse_vocabularies (const sourcemeta::core::JSON &schema, const SchemaResolver &resolver, std::string_view default_dialect="") -> std::optional< Vocabularies > |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::parse_vocabularies (const sourcemeta::core::JSON &schema, const SchemaBaseDialect base_dialect) -> std::optional< Vocabularies > |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::vocabularies (const sourcemeta::core::JSON &schema, const SchemaResolver &resolver, std::string_view default_dialect="") -> Vocabularies |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::vocabularies (const SchemaResolver &resolver, const SchemaBaseDialect base_dialect, std::string_view dialect) -> Vocabularies |
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto | sourcemeta::blaze::parse_schema_type (const sourcemeta::core::JSON &type) -> sourcemeta::core::JSON::TypeSet |
A set of JSON Schema utilities across dialects.
This functionality is included as follows:
| class sourcemeta::blaze::CompilerError |
An error that represents a schema compilation failure event
| class sourcemeta::blaze::CompilerInvalidRegexError |
An error that represents an invalid regular expression during compilation
| class sourcemeta::blaze::CompilerReferenceTargetNotSchemaError |
An error that represents a reference target that is not a valid schema
| class sourcemeta::blaze::CompilerInvalidEntryPoint |
An error that represents an invalid compilation entrypoint
| class sourcemeta::blaze::SchemaError |
An error that represents a general schema error event
| class sourcemeta::blaze::SchemaResolutionError |
An error that represents a schema resolution failure event
| class sourcemeta::blaze::SchemaRelativeMetaschemaResolutionError |
An error that represents a relative meta-schema resolution failure event Relative references to meta-schemas are invalid as per the specification See https://json-schema.org/draft/2020-12/json-schema-core#section-8.1.1-2
Public Member Functions | |
| SchemaRelativeMetaschemaResolutionError (const std::string_view identifier) | |
Public Member Functions inherited from sourcemeta::blaze::SchemaResolutionError | |
| SchemaResolutionError (const std::string_view identifier, const char *message) | |
| auto | what () const noexcept -> const char *override |
| auto | identifier () const noexcept -> std::string_view |
| class sourcemeta::blaze::SchemaVocabularyError |
An error that represents a schema vocabulary error
Public Member Functions | |
| SchemaVocabularyError (const std::string_view uri, const char *message) | |
| auto | what () const noexcept -> const char *override |
| auto | uri () const noexcept -> std::string_view |
| class sourcemeta::blaze::SchemaReferenceError |
An error that represents a schema resolution failure event
| class sourcemeta::blaze::SchemaUnknownDialectError |
| class sourcemeta::blaze::SchemaUnknownBaseDialectError |
| class sourcemeta::blaze::SchemaReferenceObjectResourceError |
In JSON Schema Draft 7 and older, a schema that defines $ref is a reference object where every other keywords are ignored
| class sourcemeta::blaze::SchemaBaseDialectError |
An error that represents an unrecognized base dialect
Public Member Functions | |
| SchemaBaseDialectError (const std::string_view base_dialect) | |
| auto | what () const noexcept -> const char *override |
| auto | base_dialect () const noexcept -> std::string_view |
| class sourcemeta::blaze::SchemaKeywordError |
An error that represents a schema keyword error
| struct sourcemeta::blaze::SchemaWalkerResult |
A structure that encapsulates the result of walker over a specific keyword
Public Member Functions | |
| SchemaWalkerResult (const SchemaWalkerResult &)=delete | |
| auto | operator= (const SchemaWalkerResult &) -> SchemaWalkerResult &=delete |
| SchemaWalkerResult (SchemaWalkerResult &&)=default | |
| auto | operator= (SchemaWalkerResult &&) -> SchemaWalkerResult &=default |
| SchemaWalkerResult (SchemaKeywordType type_, std::optional< Vocabularies::URI > vocabulary_, std::unordered_set< std::string_view > dependencies_, std::unordered_set< std::string_view > order_dependencies_, sourcemeta::core::JSON::TypeSet instances_) | |
Public Attributes | |
| SchemaKeywordType | type |
| The walker strategy to continue traversing across the schema. | |
| std::optional< Vocabularies::URI > | vocabulary |
| The vocabulary associated with the keyword, if any. | |
| std::unordered_set< std::string_view > | dependencies |
| std::unordered_set< std::string_view > | order_dependencies |
| sourcemeta::core::JSON::TypeSet | instances |
| The JSON instance types that this keyword applies to (empty means all) | |
| std::unordered_set<std::string_view> sourcemeta::blaze::SchemaWalkerResult::dependencies |
The keywords a given keyword depends on (if any) during the evaluation process
| std::unordered_set<std::string_view> sourcemeta::blaze::SchemaWalkerResult::order_dependencies |
The keywords a given keyword depends on for evaluation ordering purposes only (not semantic dependencies)
| struct sourcemeta::blaze::SchemaIteratorEntry |
An entry of a schema iterator.
Public Attributes | |
| std::optional< sourcemeta::core::WeakPointer > | parent |
| sourcemeta::core::WeakPointer | pointer |
| std::string_view | dialect |
| Vocabularies | vocabularies |
| std::optional< SchemaBaseDialect > | base_dialect |
| std::reference_wrapper< const sourcemeta::core::JSON > | subschema |
| bool | orphan |
| bool | property_name |
| struct sourcemeta::blaze::Vocabularies |
Optimized vocabulary set using bitflags for known vocabularies and a fallback std::unordered_map for custom vocabularies.
Public Types | |
| enum class | Known : std::uint8_t { JSON_Schema_Draft_0 = 0 , JSON_Schema_Draft_0_Hyper = 1 , JSON_Schema_Draft_1 = 2 , JSON_Schema_Draft_1_Hyper = 3 , JSON_Schema_Draft_2 = 4 , JSON_Schema_Draft_2_Hyper = 5 , JSON_Schema_Draft_3 = 6 , JSON_Schema_Draft_3_Hyper = 7 , JSON_Schema_Draft_4 = 8 , JSON_Schema_Draft_4_Hyper = 9 , JSON_Schema_Draft_6 = 10 , JSON_Schema_Draft_6_Hyper = 11 , JSON_Schema_Draft_7 = 12 , JSON_Schema_Draft_7_Hyper = 13 , JSON_Schema_2019_09_Core = 14 , JSON_Schema_2019_09_Applicator = 15 , JSON_Schema_2019_09_Validation = 16 , JSON_Schema_2019_09_Meta_Data = 17 , JSON_Schema_2019_09_Format = 18 , JSON_Schema_2019_09_Content = 19 , JSON_Schema_2019_09_Hyper_Schema = 20 , JSON_Schema_2020_12_Core = 21 , JSON_Schema_2020_12_Applicator = 22 , JSON_Schema_2020_12_Unevaluated = 23 , JSON_Schema_2020_12_Validation = 24 , JSON_Schema_2020_12_Meta_Data = 25 , JSON_Schema_2020_12_Format_Annotation = 26 , JSON_Schema_2020_12_Format_Assertion = 27 , JSON_Schema_2020_12_Content = 28 , OpenAPI_3_1_Base = 29 , OpenAPI_3_2_Base = 30 } |
| using | URI = std::variant< Known, sourcemeta::core::JSON::String > |
Public Member Functions | |
| Vocabularies (const Vocabularies &)=default | |
| Vocabularies (Vocabularies &&) noexcept=default | |
| auto | operator= (const Vocabularies &) -> Vocabularies &=default |
| auto | operator= (Vocabularies &&) noexcept -> Vocabularies &=default |
| Vocabularies (std::initializer_list< std::pair< sourcemeta::core::JSON::String, bool > > init) | |
| Construct from initializer list. | |
| Vocabularies (std::initializer_list< std::pair< Known, bool > > init) | |
| Construct from initializer list using known vocabulary enums. | |
| auto | contains (const sourcemeta::core::JSON::String &uri) const noexcept -> bool |
| Check if a vocabulary is enabled. | |
| auto | contains (Known vocabulary) const noexcept -> bool |
| Check if a known vocabulary is enabled. | |
| auto | contains_any (std::initializer_list< Known > vocabularies) const noexcept -> bool |
| Check if any of the given known vocabularies are enabled. | |
| auto | insert (const sourcemeta::core::JSON::String &uri, bool required) noexcept -> void |
| Insert a vocabulary with its required/optional status. | |
| auto | insert (Known vocabulary, bool required) noexcept -> void |
| Insert a known vocabulary with its required/optional status. | |
| auto | get (const sourcemeta::core::JSON::String &uri) const noexcept -> std::optional< bool > |
| Get vocabulary status by URI. | |
| auto | get (Known vocabulary) const noexcept -> std::optional< bool > |
| Get known vocabulary status. | |
| auto | size () const noexcept -> std::size_t |
| Get the number of vocabularies (required + optional + custom) | |
| auto | empty () const noexcept -> bool |
| Check if there are no vocabularies. | |
| auto | has_unknown () const noexcept -> bool |
| Check if there are any unknown vocabularies. | |
| auto | throw_if_any_unsupported (const std::unordered_set< URI > &supported, const char *message) const -> void |
| auto | throw_if_any_unknown_required (const char *message) const -> void |
| Throw if any unknown vocabulary is required. | |
Static Public Attributes | |
| static constexpr std::size_t | KNOWN_VOCABULARY_COUNT = 31 |
| using sourcemeta::blaze::Vocabularies::URI = std::variant<Known, sourcemeta::core::JSON::String> |
A vocabulary URI type that can be either a known vocabulary enum or a custom string URI
| class sourcemeta::blaze::SchemaIterator |
Return an iterator over the subschemas of a given JSON Schema definition according to the applicators understood by the provided walker function. This walker recursively traverses over every subschema of the JSON Schema definition, including the top-level schema, reporting back each subschema.
For example:
Public Types | |
| using | const_iterator = typename internal::const_iterator |
Public Member Functions | |
| SchemaIterator (const sourcemeta::core::JSON &input, const SchemaWalker &walker, const SchemaResolver &resolver, std::string_view default_dialect="") | |
| auto | begin () const -> const_iterator |
| auto | end () const -> const_iterator |
| auto | cbegin () const -> const_iterator |
| auto | cend () const -> const_iterator |
| class sourcemeta::blaze::SchemaIteratorFlat |
Return an iterator over the subschemas of a given JSON Schema definition according to the applicators understood by the provided walker function. This walker traverse over the first-level of subschemas of the JSON Schema definition, ignoring the top-level schema and reporting back each subschema.
Note that we don't promise any specific walking ordering.
For example:
Public Types | |
| using | const_iterator = typename internal::const_iterator |
Public Member Functions | |
| SchemaIteratorFlat (const sourcemeta::core::JSON &input, const SchemaWalker &walker, const SchemaResolver &resolver, std::string_view default_dialect="") | |
| auto | begin () const -> const_iterator |
| auto | end () const -> const_iterator |
| auto | cbegin () const -> const_iterator |
| auto | cend () const -> const_iterator |
| class sourcemeta::blaze::SchemaKeywordIterator |
Return an iterator over the top-level keywords of a given JSON Schema definition in the order in which an implementation must evaluate them, given the vocabularies in use by the schema.
For example:
Public Types | |
| using | const_iterator = typename internal::const_iterator |
Public Member Functions | |
| SchemaKeywordIterator (const sourcemeta::core::JSON &input, const SchemaWalker &walker, const Vocabularies &vocabularies) | |
| auto | begin () const -> const_iterator |
| auto | end () const -> const_iterator |
| auto | cbegin () const -> const_iterator |
| auto | cend () const -> const_iterator |
| using sourcemeta::blaze::SchemaResolver = typedef std::function<std::optional<sourcemeta::core::JSON>(std::string_view)> |
Some functions need to reference other schemas by their URIs. To accomplish this in a generic and flexible way, these functions take resolver functions as arguments, of the type sourcemeta::blaze::SchemaResolver.
For convenience, we provide the following default resolvers:
You can implement resolvers to read from a local storage, to send HTTP requests, or anything your application might require. Unless your resolver is trivial, it is recommended to create a callable object that implements the function interface.
| using sourcemeta::blaze::SchemaWalker = typedef std::function<const SchemaWalkerResult &( std::string_view, const Vocabularies &)> |
For walking purposes, some functions need to understand which JSON Schema keywords declare other JSON Schema definitions. To accomplish this in a generic and flexible way that does not assume the use any vocabulary other than core, these functions take a walker function as argument.
|
strong |
All the known JSON Schema base dialects
|
strong |
Determines the type of a JSON Schema keyword
|
strong |
The reference type
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::anonymize | ( | sourcemeta::core::JSON & | schema, |
| const SchemaBaseDialect | base_dialect | ||
| ) | -> void |
This function removes the top-level URI identifier of the given schema, if any, given you know its base dialect. It is the caller responsibility to ensure the schema doesn't perform relative references that might have depended on such top-level identifier. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::base_dialect | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "", |
||
| bool | allow_dialect_override = true |
||
| ) | -> std::optional< SchemaBaseDialect > |
Get the base dialect that applies to the given schema. If you set a default dialect URI, this will be used if the given schema does not declare the $schema keyword. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::dialect | ( | const sourcemeta::core::JSON & | schema, |
| std::string_view | default_dialect = "", |
||
| bool | allow_dialect_override = true |
||
| ) | -> std::string_view |
Get the dialect URI that corresponds to a JSON Schema instance. The result is empty if the dialect cannot be determined. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::identify | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaBaseDialect | base_dialect, | ||
| std::string_view | default_id = "" |
||
| ) | -> std::string_view |
A shortcut to sourcemeta::blaze::identify if you know the base dialect of the schema.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::identify | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "", |
||
| std::string_view | default_id = "", |
||
| bool | allow_dialect_override = true |
||
| ) | -> std::string_view |
This function returns the URI identifier of the given schema, or an empty string view if the schema has no identifier. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::is_empty_schema | ( | const sourcemeta::core::JSON & | schema | ) | -> bool |
This function returns true if the given JSON instance is a schema semantically equivalent to the empty schema. For example:
|
noexcept |
Check if a given identifier corresponds to a known built-in schema
|
noexcept |
Check if a given URI corresponds to an official schema released by the JSON Schema organisation
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::is_schema | ( | const sourcemeta::core::JSON & | schema | ) | -> bool |
This function returns true if the given JSON instance is of a schema-compatible type: an object or a boolean. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::metaschema | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "" |
||
| ) | -> sourcemeta::core::JSON |
Get the metaschema document that describes the given schema. For example:
This function will throw if the metaschema cannot be determined or resolved.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::metaschema_try_embedded | ( | const sourcemeta::core::JSON & | schema, |
| std::string_view | identifier, | ||
| const SchemaResolver & | resolver | ||
| ) | -> const sourcemeta::core::JSON * |
Try to locate the meta-schema that the given schema declares from within the schema itself, as self-contained schemas embed the meta-schemas they depend on. The result points into the given document and is null if no valid embedded meta-schema could be found. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::parse_schema_type | ( | const sourcemeta::core::JSON & | type | ) | -> sourcemeta::core::JSON::TypeSet |
Parse the value of a JSON Schema type keyword (which can be a string or an array of strings) into a set of native JSON types. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::parse_vocabularies | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaBaseDialect | base_dialect | ||
| ) | -> std::optional< Vocabularies > |
A shortcut to sourcemeta::blaze::parse_vocabularies when the base dialect is already known.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::parse_vocabularies | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "" |
||
| ) | -> std::optional< Vocabularies > |
Parse the $vocabulary keyword from a given schema, if set. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::reidentify | ( | sourcemeta::core::JSON & | schema, |
| std::string_view | new_identifier, | ||
| const SchemaBaseDialect | base_dialect | ||
| ) | -> void |
A shortcut to sourcemeta::blaze::reidentify if you know the base dialect of the schema.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::reidentify | ( | sourcemeta::core::JSON & | schema, |
| std::string_view | new_identifier, | ||
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "" |
||
| ) | -> void |
This function sets the identifier of a schema, replacing the existing one, if any. For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::schema_keyword_priority | ( | const std::string_view | keyword, |
| const Vocabularies & | vocabularies, | ||
| const SchemaWalker & | walker | ||
| ) | -> std::uint64_t |
Calculate the priority of a keyword that determines the ordering in which a JSON Schema implementation should evaluate keyword on a subschema. It does so based on the keyword dependencies expressed in the schema walker. The higher the priority, the more the evaluation of such keyword must be delayed.
For example:
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::schema_resolver | ( | const std::string_view | identifier | ) | -> std::optional< sourcemeta::core::JSON > |
A default resolver that relies on built-in official schemas.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::schema_walker | ( | const std::string_view | keyword, |
| const Vocabularies & | vocabularies | ||
| ) | -> const SchemaWalkerResult & |
A default schema walker with support for a wide range of drafts
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::to_base_dialect | ( | const std::string_view | base_dialect | ) | -> std::optional< SchemaBaseDialect > |
Parse a base dialect URI to its enum representation
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::to_string | ( | const SchemaBaseDialect | base_dialect | ) | -> std::string_view |
Stringify a base dialect to its URI
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::vocabularies | ( | const SchemaResolver & | resolver, |
| const SchemaBaseDialect | base_dialect, | ||
| std::string_view | dialect | ||
| ) | -> Vocabularies |
A shortcut to sourcemeta::blaze::vocabularies based on the base dialect and dialect URI.
| SOURCEMETA_BLAZE_FOUNDATION_EXPORT auto sourcemeta::blaze::vocabularies | ( | const sourcemeta::core::JSON & | schema, |
| const SchemaResolver & | resolver, | ||
| std::string_view | default_dialect = "" |
||
| ) | -> Vocabularies |
List the vocabularies that a specific schema makes use of. If you set a default dialect URI, this will be used if the given schema does not declare the $schema keyword. The resulting map values are set to true or false depending on whether the corresponding vocabulary is required or optional, respectively. For example: