forked from golemcloud/golem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreusable_open_api_definition.json
73 lines (72 loc) · 1.65 KB
/
reusable_open_api_definition.json
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
{
"openapi": "3.0.0",
"x-golem-worker-bridge-mount-info": {
"domain": "amazon.com",
"subdomain": "api"
},
"info": {
"title": "Sample API",
"version": "1.0.2"
},
"servers": [
{
"url": "http://169.254.141.101:9006"
}
],
"paths": {
"/{user-id}/get-cart-contents": {
"x-golem-worker-bridge": {
"worker-name": "worker-${request.path.user-id}",
"component-id": "2696abdc-df3a-4771-8215-d6af7aa4c408",
"response" : "${ let result = golem:it/api/get-cart-contents(); { headers : { content-type: \"application/json\", userid: \"foo\"}, body: result, status: 200} }"
},
"get": {
"summary": "Get Cart Contents",
"description": "Get the contents of a user's cart",
"parameters": [
{
"name": "user-id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content":{
"application/json": {
"schema": {
"$ref": "#/components/schemas/CartItem"
}
}
}
},
"404": {
"description": "Contents not found"
}
}
}
}
},
"components": {
"schemas": {
"CartItem": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"price": {
"type": "number"
}
}
}
}
}
}