- describe a process needed to prepare value from context
- describe a process needed to validate provided value
- describe expected type
- describe behavior if value not provided
- all in one simple definition of a parameter no longer than one line
- reference described pameter or type within the document containing definition or reference to one
- present processes and definitions as functional sequences and / or call chains
simple textual reference to contextual entity within document e.g. "city" - is an entity with known attributes on which described interface operates on it is contextualy described
cast abstract textual definition of entity to contextualy defined type e.g. in document we contextualy define a type "city" as entity, having id, name and location(lat,lng) attributes
city(MSK)
abstract definition "MSK", which references Moscow, Russia - is casted to known contextual entity "city" so output value of this sentence is object of type "city", representing a city of Moscow with some integer id, name equal to "Moscow" and location(lat,lng) subentity
pick an attribute from object of type by calling attribute name from typeReference e.g.
id(city)
meas what you need to supply attribute "id" of type "city"
transformer element allows you to describe sequences of transformations applyed to type or value under definition of transformation you can understood:
- picking attribute from typeReference
- applying self-describable function to typeReference
- calling contextualy known method of type
e.g.
city.location.latitude - is chain to peek a nested attribute from typeReference
enum([city].name) - extract and enumerate name from all cities
used to describe changeable value treating dependent on other parameter or abstract condition
<address(&channelType)=email/phone:string|null>
treating of this parameter's value is dependent on others parameter value () and could be resolved as email or phone
one may specify expected simple type as parameter value, transformation result, default value or full definition of parameter e.g.
<int> - expecting some integer value
<str(100)> - expecting string no longer than 100 chars
<enum([city].id):int> - expecting enumerated city id as int
one may specify parameter expected to be a collection of type e.g.
<[int]> - expecting array of int
<list([city].location)=[location]> - expecting collection of locations extracted from city collection