-
Notifications
You must be signed in to change notification settings - Fork 4
schema data
Data expressions define data instances used by some schema parts such as annotations or default parameter values. Values can be created for all supported type kinds. Errors and metadata are not supported.
Although in most cases value type follows from the context, e.g. annotation or parameter type, sometimes it is
needed to specify value type explicitly, for instance if actual parameter value is a sub-type of declared parameter
type. To allow this any value can be prepended by a type specification <type reference>
, followed
by @
for primitives and null
.
Examples:
MyType@null
Person < id: UserId@777 >
Syntax: null
, prepended by optional type specification.
Sequence of characters in double quotes. "
character can be escaped using backslash. Can optionally
be prepended by type specification.
Examples:
"\"Sugar Ray\" Leonard"
MyType@"a string"
Integer and floating point numbers in scientific notation, can optionally be prepended by type specification. Presicion should not exceed corresponding data types.
Examples:
0
MyType@-1
2.99792e+08
Syntax: <type>? { <fields> }
, where <type>?
is optional type specification
and <fields>
is a list of field values separated by optional commas.
Field value is <field name> : <data expression>
.
Examples:
{}
UserRecord{ firstName: "Alfred", lastName: "Hitchcock" }
Syntax: <type>? ( <entries> )
, where <type>?
is optional type specification
and <entries>
is a list of map entries separated by optional commas.
Map entry is <data expression> : <data expression>
.
Examples:
RootsMap( 2: 1.41421, 1: 1, 0: 0, -1: null )
Syntax: <type>? [ <entries> ]
, where <type>?
is optional type specification
and <entries>
is a list of data expressions separated by optional commas.
Examples:
[ 1914, 1939, null ]
Syntax: 〈type〉? < 〈entries〉 >
, where 〈type〉?
is optional type specification
and 〈entries〉
is a list of tag values separated by optional commas.
Tag value is <tag name> : <data expression>
.
Examples:
User< id: 1, `record`: { firstName: "Alfred" } >
record
has to be escaped because it's one of the schema keywords.