json_schema v0.3.0 JsonSchema.Parser.ObjectParser View Source
Parses a JSON schema object type:
{
"type": "object",
"properties": {
"color": {
"$ref": "#/color"
},
"title": {
"type": "string"
},
"radius": {
"type": "number"
}
},
"required": [ "color", "radius" ]
}
Into an JsonSchema.Types.ObjectType
Link to this section Summary
Functions
Creates a property dictionary based on a type dictionary and a type path.
Parses a JSON schema object type into an JsonSchema.Types.ObjectType
.
Returns true if the json subschema represents an allOf type.
Link to this section Functions
Link to this function
create_property_dict(type_dict, path, id)
View Sourcecreate_property_dict(JsonSchema.Types.typeDictionary(), URI.t(), URI.t() | nil) :: JsonSchema.Types.propertyDictionary()
Creates a property dictionary based on a type dictionary and a type path.
Examples
iex> type_dict = %{}
...> path = URI.parse("#")
...> id = "http://www.example.com/root.json"
...> JsonSchema.Parser.ObjectParser.create_property_dict(type_dict, path, id)
%{}
Link to this function
parse(schema_node, parent_id, id, path, name)
View Sourceparse( JsonSchema.Types.schemaNode(), URI.t() | nil, URI.t(), URI.t(), String.t() ) :: JsonSchema.Parser.ParserResult.t()
Parses a JSON schema object type into an JsonSchema.Types.ObjectType
.
Returns true if the json subschema represents an allOf type.
Examples
iex> type?(%{}) false
iex> an_object = %{"properties" => %{"name" => %{"type" => "string"}}} iex> type?(an_object) true