"$schema": "http://brutusin.org/json/json-schema-spec"

October 22, 2015 ยท View on GitHub

This document defines some extensions to the http://json-schema.org/draft-03/schema JSON schema specification used by Brutusin modules

##Path expressions Path expressions allow referencing JSON data and schema subparts and traversing the JSON node tree.

This document defines new expression semantics, supporting data and schema projections (wildcard expressions evaluating to multiple nodes), and also keeping explicit information of the schema structure, being useful to validate that a reusable expression is applied to a node of the same structure that the original one (this is the main point for not adopting JsonPath semantics).

OperatorApplied to JsonNodeApplied to JsonSchema
$The root nodeSchema of root node
.<name>Dot-notated childSchema of child node
#Numeric wildcard. Selects all elements of an arraySchema of the array node
*String wildcard. Selects all properties of an objectSchema of the object node. Only valid in schemas having additionalProperties
['<name>']Bracket-notated child or childrenOnly valid in schemas having additionalProperties. Otherwise use dot-notation
[<number>]number-th element in the arraySchema of the element node
[$]Last element in the arraySchema of the element node

Additional schema properties:

PropertySupported valuesDescription
index["index","facet"]For indexation purposes
dependsOnarray of path expressions stringsUsed to state that this schema is dynamic and depends on the values of the instance document in a certain set of subparts represented by path expressions.

Additional formats for string schemas:

Format valueDescription
fileThe instances of this schema are strings representing a file
inputstreamThe instances of this schema are strings referencing an attached input stream.