View Source JsonSchema.Resolver (json_schema v0.4.0)
Module containing functions for resolving types. Main function being
the resolve_type
function.
Link to this section Summary
Functions
Resolves a type given its identifier
, parent
identifier of the resolving
subschema, the subschema's enclosing SchemaDefinition
and the schema
dictionary of the whole set of parsed JSON schema files.
Link to this section Functions
@spec resolve_type( JsonSchema.Types.typeIdentifier(), JsonSchema.Types.typeIdentifier(), JsonSchema.Types.SchemaDefinition.t(), JsonSchema.Types.schemaDictionary() ) :: {:ok, {JsonSchema.Types.typeDefinition(), JsonSchema.Types.SchemaDefinition.t()}} | {:error, JsonSchema.Parser.ParserError.t()}
Resolves a type given its identifier
, parent
identifier of the resolving
subschema, the subschema's enclosing SchemaDefinition
and the schema
dictionary of the whole set of parsed JSON schema files.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/circle.json",
"title": "Circle",
"description": "Schema for a circle shape",
"type": "object",
"properties": {
"radius": {
"type": "number"
},
"center": {
"$ref": "http://example.com/definitions.json#point"
},
"color": {
"$ref": "http://example.com/definitions.json#color"
}
},
"required": ["center", "radius"]
}