forked from Microservice-API-Patterns/MDSL-Specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloCRUDWorld.mdsl
54 lines (51 loc) · 2.38 KB
/
HelloCRUDWorld.mdsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
API description HelloCRUDWorld
data type TestDTO1 "dto1": {"dtoKey1":ID<int>, "dtoValue":D<string>}*
data type TestDTO2 "dto2a": {"dtoKey":ID<int>?, "dto1Nested":TestDTO1*}
data type TestDTO2a "apl": ("a1":ID<int>?, "a2":D<string>)* // * not supported yet
data type TestDTO3 "noDTOButInt": D<int>
endpoint type SampleEntityInformationHolder
exposes
operation createOp // with responsibility STATE_CREATION_OPERATION
expecting
headers {"h1":D<string>, "h2":D<int>} // should not be a deep tree but AP, APL or flat PT
// TODO id strings "expecting" and "delivering" not used, can they go to description if present?
payload "expecting": {"primaryIntegerKey":ID<int>, "atLeastOneString":D<string>+}
delivering
payload "delivering": TestDTO2+
operation getOp
expecting
payload TestDTO2*
// payload "dto2": {"dtoKey":ID<int>?, "dto1Nested":TestDTO1*}*
// payload "someData":D<string>+
// payload {"primaryKey":ID<int>, "someData":D<string>+}
delivering
payload "delivering": TestDTO2 // TestDTO1*
operation updateOp // with responsibility STATE_CREATION_OPERATION
expecting
payload "updateObject": {"dtoKey":ID<int>?, "dto1Nested":TestDTO1*}*
delivering
payload TestDTO1?
operation deleteOp
expecting
// description is there but not "primaryKey" (hard coded tbc)?
payload "primaryKey":ID<int>
// delivering
// payload "successCode" // "successCode" text not used, answer is an empty "object" (ok)
API provider SampleAPIProvider
offers SampleEntityInformationHolder
at endpoint location "https://some.sample.domain/apiEndpoint"
via protocol HTTP
binding
resource Home at "/eihHome/{primaryIntegerKey}/{atLeastOneString}"
operation createOp to PUT
// element "h1" realized as HEADER parameter // must be
// element h2 realized as HEADER parameter // must be
all elements realized as QUERY parameters
// all elements realized as COOKIE parameters
// all elements realized as HEADER parameters
// all elements realized as PATH parameters
operation getOp to GET
all elements realized as QUERY parameters
// all elements realized as COOKIE parameters
// all elements realized as HEADER parameters
// all elements realized as PATH parameters