WblMetaSchema

WblMetaSchema — JSON meta-schema loading

Stability Level

Unstable, unless otherwise indicated

Functions

Types and Values

Includes

#include <libwalbottle/wbl-meta-schema.h>

Description

JSON meta-schemas are schemas which describe the JSON schema format. They are used to validate JSON schemas.

There are currently two meta-schemas: WBL_META_SCHEMA_META_SCHEMA and WBL_META_SCHEMA_HYPER_META_SCHEMA. The latter is a superset of the former, and is designed for validating hypertext in addition to the core schema keywords.

Functions

wbl_meta_schema_load ()

GInputStream *
wbl_meta_schema_load (WblMetaSchemaType meta_schema_type,
                      GError **error);

Load a meta-schema and return an input stream for its serialised JSON data.

The meta-schemas are stored as resources within the library, so can safely be read synchronously without blocking.

Parameters

meta_schema_type

type of meta-schema to load

 

error

return location for a GError, or NULL

 

Returns

input stream for the meta-schema file.

[transfer full]

Since: 0.1.0


wbl_meta_schema_load_schema ()

WblSchema *
wbl_meta_schema_load_schema (WblMetaSchemaType meta_schema_type,
                             GError **error);

Load and parse a meta-schema, returning a WblSchema containing it. On error, error will be set, and NULL will be returned (rather than an empty WblSchema instance).

Parameters

meta_schema_type

type of meta-schema to load

 

error

return location for a GError, or NULL

 

Returns

WblSchema instance holding the parsed and loaded meta-schema.

[transfer full]

Since: 0.1.0

Types and Values

enum WblMetaSchemaType

Identifiers for the different meta-schemas available for validating JSON schemas.

Members

WBL_META_SCHEMA_META_SCHEMA

Meta-schema used for schemas written for pure validation.

 

WBL_META_SCHEMA_HYPER_META_SCHEMA

Meta-schema used for schemas written for validation and hyper-linking.

 

Since: 0.1.0