-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHTTPBindingErrorReportAndSecurityPolicies.mdsl
65 lines (61 loc) · 2.81 KB
/
HTTPBindingErrorReportAndSecurityPolicies.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
55
56
57
58
59
60
61
62
63
64
65
API description HTTPBindingWithReportAndPolicy
data type FlatParameterTree {"id":ID<string>, "md":MD<string>, "dInt": D<int>, "lString": L<string>, "dLong": D<long>, D<bool>}
data type NestedParameterTree {"npt1":D<string>, "npt2":FlatParameterTree}
data type FlatResponseDTR {"fr1":D<string>, "fr2":MD<string>}
data type NestedResponseDTR {"r1":ID<string>, "r2":L<string>, FlatResponseDTR}
data type AnotherNestedTree {"p1":D<string>, {"anotherTree":D<string>}}
data type ErrorReport {"code":D<int>, "message":MD<int>}
data type Credentials ("user":ID<string>, "password":MD<raw>)
endpoint type ReportAndPolicyEnabledPortType
exposes
operation createOperation
expecting
payload NestedParameterTree
delivering
payload FlatResponseDTR
protected by policy BasicAuthenticationSample
operation getOperation
expecting
payload "aQueryParameter": D<string>
delivering
payload "queryResponse": NestedResponseDTR
reporting error ServerError "e500": MD<int>
operation putOperation
expecting
payload FlatParameterTree
delivering
payload NestedResponseDTR
reporting error ServerError2 "e502": MD<int>
protected by policy BasicAuthenticationSample2
operation patchOperation
expecting
// AP and APL do not work yet, NPE when looking for name:
headers {"customHeader1":D<string>, "customHeader2":D<string>} // no need to define standard protocol headers
payload FlatParameterTree
delivering
payload FlatParameterTree
operation deleteOperation
expecting
payload FlatParameterTree
delivering
payload NestedResponseDTR
API provider HelloHTTPEndpointNoBinding2
offers ReportAndPolicyEnabledPortType
at endpoint location "/mySampleHTTPEndpoint"
via protocol HTTP binding
resource Home // no relative URI here
// note: not all operations bound, so not all included in generated OAS
operation createOperation to POST
all elements realized as BODY parameters // global binding
policy BasicAuthenticationSample realized as API_KEY with Credentials "someCredentialText"
operation getOperation to GET
element "aQueryParameter" realized as QUERY parameter // individual binding
report ServerError realized as 500 with "SomeExtraErrorReportText"
operation putOperation to PUT
// default element bindings
report ServerError2 realized as 502 with "SomeExtraErrorReportText"
policy BasicAuthenticationSample2 realized as OAUTH_FLOW with openIdConnectUrl "http://tbc.tbc"
operation patchOperation to PATCH
// element "customHeader1" realized as HEADER parameter // somewhat redundant
// element "customHeader2" realized as HEADER parameter // somewhat redundant
// delete operation not bound (in this HTTP binding)