forked from croz-ltd/ibm-api-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.yaml
More file actions
84 lines (84 loc) · 2.08 KB
/
Copy pathtest-api.yaml
File metadata and controls
84 lines (84 loc) · 2.08 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
swagger: '2.0'
info:
title: test-api
x-ibm-name: test-api
version: 1.0.0
schemes:
- https
basePath: /test-api
security:
- {}
securityDefinitions:
clientID:
type: apiKey
in: header
name: X-IBM-Client-Id
x-ibm-configuration:
cors:
enabled: true
gateway: datapower-api-gateway
type: rest
phase: realized
enforced: true
testable: true
assembly:
execute:
- switch:
version: 2.0.0
title: switch
case:
- condition: ($httpVerb() = 'GET' and $operationPath() = '/test')
execute:
- gatewayscript:
version: 2.0.0
title: gws-respond-test
source: |
context.set('message.body','{"msg":"Hello test!"}');
- condition: ($httpVerb() = 'GET' and $operationPath() = '/test-public')
execute:
- gatewayscript:
version: 2.0.0
title: gws-respond-test-public
source: >
context.set('message.body','{"msg":"Hello
test-public!"}');
- condition: ($httpVerb() = 'GET' and $operationPath() = '/test-error')
execute:
- gatewayscript:
version: 2.0.0
title: gws-respond-error
source: |
throw "Something wrong happend."
properties:
target-url:
value: 'http://example.com/operation-name'
description: The URL of the target service
encoded: false
application-authentication:
certificate: false
paths:
/test-error:
get:
responses:
'200':
schema:
type: string
description: success
/test:
get:
responses:
'200':
description: success
schema:
type: string
security:
- clientID: []
consumes: []
produces: []
/test-public:
get:
responses:
'200':
schema:
type: string
description: success