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

Link to this function

resolve_type(identifier, parent, schema_def, schema_dict)

View Source

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"]
}