You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,7 +76,7 @@ If you want to contribute to MDSL, you have to clone this repo and generate the
76
76
77
77
## Change Log
78
78
79
-
The current version of the MDSL language is 5.1; the tool version is 5.1.2. This MDSL version extends service contracts with support for events, states, flows, compensation (as experimental technology previews). It also supports true REST level 3 concepts both on the abstract endpoint type level and in the redesigned bindings and comes with additional Fremarker generators (Markdown reports, ALPS).
79
+
The current version of the MDSL language is 5.2; the tool version is 5.2.0. This MDSL version extends service contracts with support for events, states, flows, compensation (as experimental technology previews). It also supports true REST level 3 concepts both on the abstract endpoint type level and in the redesigned bindings and comes with additional Fremarker generators (Markdown reports, ALPS).
80
80
81
81
See [change log](changelog.md) for an evolution history; see GitHub [release notes](https://github.com/Microservice-API-Patterns/MDSL-Specification/releases) for additional update information.
Copy file name to clipboardExpand all lines: docs/datacontract.md
+19-101
Original file line number
Diff line number
Diff line change
@@ -11,47 +11,49 @@ Data Contracts and Schemas in MDSL
11
11
12
12
## Use Cases for MDSL Data Type Models
13
13
14
-
MDSL aims at supporting agile modeling. Any service API exposes a published language of some kind This language contains data elements in several places:
14
+
MDSL aims at supporting agile modeling. Any service API exposes a published language of some kind. Such published language contains data elements in several places:
15
15
16
-
* Payload and headers of operations specified in an MDSL service [endpoint contract](./servicecontract)
17
-
* Service Level Objectives (SLOs) and/or Service Level Indicators (SLIs) that are part of [Service Level Agreements (SLAs)](https://microservice-api-patterns.org/patterns/quality/qualityManagementAndGovernance/ServiceLevelAgreement)
18
-
* Data Transfer Objects (DTOs) or, more precisely, Data Transfer Representations (DTRs)
16
+
* Payload and headers of operations, specified in an MDSL service [endpoint contract](./servicecontract).
17
+
* Service Level Objectives (SLOs) and/or Service Level Indicators (SLIs), being part of [Service Level Agreements (SLAs)](https://microservice-api-patterns.org/patterns/quality/quali.tyManagementAndGovernance/ServiceLevelAgreement)
18
+
* Data Transfer Objects (DTOs) or, since we are not inside an object-oriented program here, *Data Transfer Representations (DTRs)*.
19
19
20
-
<!-- TODO feature link types, event types-->
20
+
*Note:* Versions 5.1 the MDSL grammar introduced link types and event types. These features are still under design and development; the MDSL tools do not support them yet. A first sample specification featuring event types can be found [here](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/examples/examples-advanced/AdvancedServiceContractConcepts.mdsl); please view it as a technology preview. Link types are featured in the [HTTP and REST binding](./rest-binding).
21
21
22
22
## Concepts
23
23
24
-
The structure patterns from MAP form the base of the type system that is used in MDSL. *Identifier-Role-Type (IRT)* triples `"aName":D<String>` for [Atomic Parameters](https://microservice-api-patterns.org/patterns/structure/representationElements/AtomicParameter) (only the role is mandatory):
24
+
The structure patterns from MAP form the base of the type system that is used in MDSL.
25
+
26
+
*Identifier-Role-Type (IRT)* triples `"aName":D<String>` specify [Atomic Parameters](https://microservice-api-patterns.org/patterns/structure/representationElements/AtomicParameter) (only the role is mandatory):
25
27
26
28
* The optional *identifier*`"aName"` corresponds to the variable names in programming languages and data representation languages such as JSON.
27
29
* The *role* can be any [element stereotype](https://microservice-api-patterns.org/patterns/structure/) from MAP: `D` (data), `MD` (metadata), `ID` (identifier), `L` (link).
28
30
* The optional *type*`<String>` is either basic (see below) or nested/structured; it also corresponds to a concept known from type systems in programming and data representation languages.
29
31
30
-
Simple, yet powerful nesting is supported (as known from data representation languages such as JSON):
32
+
Simple, yet powerful nesting is supported, realizes the Microservice API Pattern (MAP) [Parameter Tree](https://microservice-api-patterns.org/patterns/structure/representationElements/ParameterTree):
31
33
32
34
* The nesting is expressed in an object- or block-like syntax: `{...{...}}`.
33
-
* This nesting realizes the Microservice API Pattern (MAP) [Parameter Tree](https://microservice-api-patterns.org/patterns/structure/representationElements/ParameterTree).
35
+
* This nesting syntax is similar to that in data representation languages such as JSON (and the Jolie type system).
34
36
35
-
Already existing metamodels and schema languages can be used alternatively to `MAP_TYPES`. Examples are: `JSON_SCHEMA`, `XML_SCHEMA`, and `PROTOCOL_BUFFER`.
37
+
Already existing metamodels and schema languages can be used alternatively to `MAP_TYPES`. Examples are: `JSON_SCHEMA`, `XML_SCHEMA`, and `PROTOCOL_BUFFER`. <!-- BUFFER or BUFFERS? -->
36
38
37
39
<!-- TODO (L) grammar also has `AVRO_SCHEMA` | `THRIFT_TYPE` | 'GRAPHQL_SDL' | 'OTHER' -->
38
40
39
-
MDSL specifications do not have to be complete to be useful (e.g., in early stages of service design); tools are expected to check completeness, use defaults for missing parts, etc.
41
+
*Note:*MDSL specifications do not have to be complete to be useful (e.g., in early stages of service design); tools are expected to check completeness, use defaults for missing parts, etc.
40
42
41
43
### The I in IRT: Identifiers
42
44
43
-
Identifiers must be embedded in double quotes. They may contain blanks or underscores.
45
+
Identifiers must be embedded in double quotes`"somePayloadData"`. They may contain blanks or underscores.
44
46
45
47
### The R in IRT: Role stereotypes for representation elements/data types
46
-
The role within a message payload that is played/taken by a particular part of a header or payload (a representation element in MAP terminology) is the primary specification element; identifiers and data type are optional. This three-part specification (with only one mandatory part) is quite different from the identifier-type pairs typically used in programming languages. It makes it possible to create rather compact (but still incomplete) specifications during agile API modeling. <!-- talk about rationale for this modeling decision even more? -->
48
+
The role within a message payload that is taken by a particular part of a header or payload (a representation element in MAP terminology) is the primary specification element; identifiers and data type are optional. This three-part specification (with only one mandatory part) is a bit different from the identifier-type pairs typically used in programming languages. It makes it possible to create rather compact (but still incomplete) specifications during agile API modeling. <!-- talk about rationale for this modeling decision even more? -->
47
49
48
50
An abstract, unspecified element is represented as `P` (for parameter or payload placeholder). `P` takes the place of the Role-Type elements in the IRT triple introduced above.
49
51
50
52
Concrete atomic type refinements of `P`, matching the [element stereotypes](https://microservice-api-patterns.org/patterns/structure/) in MAP, are:
51
53
52
54
*`Data` or `D`, representing a plain/basic data/value role. `D` corresponds to [Data Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/DataElement) in MAP.
53
-
*`Identifier` or `ID` for identifiers, MAP:[Id Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/IdElement).
54
-
*`Link` or `L` for link identifiers (which are network-accessible, e.g. URI, or URN), MAP: [Link Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/LinkElement).
55
+
*`Identifier` or `ID` for identifiers, corresponding to the MAP [Id Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/IdElement).
56
+
*`Link` or `L` for link identifiers (which are network-accessible, e.g. URI, or URN), in MAP: [Link Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/LinkElement).
55
57
*`Metadata` or `MD` representing metadata, MAP: [Metadata Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/MetadataElement).
56
58
57
59
`D<void>` may represent a generic, unspecified parameter (just like `P`).
@@ -77,13 +79,13 @@ Parameter trees and atomic parameter lists can be used to express optionality if
77
79
### Reuse of data type definitions (in multiple representation elements)
type sayhelloAgainResponseType {stringList: [String]}
226
-
~~~
227
-
-->
228
-
229
-
<!--
230
-
### Avro
231
-
232
-
| Avro | MAP | Comments |
233
-
|-----|-----|----------|
234
-
| Basic data types | Atomic Parameter | n/a |
235
-
| tbc | Atomic Parameter List | n/a |
236
-
| tbc | Parameter Tree | n/a |
237
-
| tbc | Cardinality of `*` or `+` | n/a |
238
-
-->
239
-
240
-
241
-
### Jolie
242
-
The MAP base types map to [simple data in Jolie](https://jolielang.gitbook.io/docs/basics/handling_simple_data) in a straightforward manner.
243
-
244
-
The same holds for the mapping of parameter trees to [Jolie data structures](https://jolielang.gitbook.io/docs/basics/data_structures).
245
-
246
-
An example can be downloaded [here](./HelloWorldAPIJolieInterfaceAndPort.ol).
164
+
See [this page](technology-mappings) for information on how MDSL data types map to their counterparts in technologies such as OpenAPI and REST, WSDL/SOAP, and gRPC.
* Tools: [Overview](./tools), [CLI](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/dsl-core/io.mdsl.cli), [update site for editor (Eclipse plugin)](./updates/)
* Language and tools repository (GitHub): [XText grammar](https://github.com/Microservice-API-Patterns/MDSL-Specification/blob/master/dsl-core/io.mdsl/src/io/mdsl/APIDescription.xtext), [examples](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/examples) folder
0 commit comments