forked from electrode-io/ernnavigation-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.json
185 lines (185 loc) · 5.04 KB
/
schema.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
"swagger": "2.0",
"info": {
"description": "Navigation helper",
"title": "Electrode Native generic navigation api (V2.0)"
},
"produces": [
"application/json"
],
"paths": {
"/navigate": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "navigate",
"parameters": [
{
"name": "route",
"in": "body",
"description": "Route object that details where to navigate next",
"required": true,
"schema": {
"$ref": "#/definitions/ErnRoute"
}
}
]
}
},
"/update": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "update",
"parameters": [
{
"name": "updatedRoute",
"in": "body",
"description": "Updated route object. This API expectes that the path of the update call is unchanged from the last navigate call. It is likely that the native implementation will reject your update call if the path is different from the last navigate call.",
"required": true,
"schema": {
"$ref": "#/definitions/ErnRoute"
}
}
]
}
},
"/finish": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "finish",
"parameters": [
{
"name": "finalPayload",
"in": "body",
"description": "Optional json string payload to pass when a flow is completed. Use this to pass in any info needed by the RN view host on the native side",
"required": false,
"schema": {
"type": "string"
}
}
]
}
},
"/back": {
"post": {
"tags": [
"EnNavigation"
],
"operationId": "back",
"parameters": [
{
"name": "route",
"in": "body",
"description": "Route object that details where to navigate next. Use this when you want to go back to a previous screen, it could be any previous screen in a given flow. If the given route is not found on the stack, native layer may push a new screen on top.",
"required": true,
"schema": {
"$ref": "#/definitions/ErnRoute"
}
}
]
}
},
"/events": {
"event": {
"tags": [
"EnNavigation"
],
"description": "Fire this event when a navigation bar button is clicked",
"operationId": "OnNavButtonClick",
"parameters": [
{
"name": "buttonId",
"in": "path",
"description": "Id of the button that is being clicked",
"required": true,
"type": "string"
}
]
}
}
},
"definitions": {
"ErnRoute": {
"properties": {
"path": {
"type": "string",
"description": "Path of the Route. Mostly the name of the container(defined by the native app) or the miniapp name. The content of the path is mainly determined by the native implemenation of the API"
},
"jsonPayload": {
"type": "string",
"description": "Optional Payload (respresented as JSON String) needed by the screen you are trying to navigate to."
},
"navigationBar": {
"$ref": "#/definitions/NavigationBar"
}
},
"required": [
"path"
]
},
"NavigationBarButton": {
"properties": {
"title": {
"type": "string",
"description": "Button title if any."
},
"icon": {
"type": "string",
"description": "Icon resource identifier that can be used find the icon"
},
"id": {
"type": "string",
"description": "Id of the button, this namespace will be used as an identifier when a button click event is emitted."
},
"location": {
"type": "string",
"description": "Allowed enums: left, right"
},
"disabled": {
"type": "boolean",
"description" : "Default to false. If set to true the button will be disabled(non-clickable)"
},
"adaLabel" : {
"type": "string",
"description": "Accessibility label"
}
},
"required": [
"id",
"location"
]
},
"NavigationBar": {
"properties": {
"title": {
"type": "string",
"description": "Title of Nav Bar"
},
"hide" : {
"type" : "boolean",
"description" : "Use to hide the navigation bar."
},
"buttons": {
"type": "array",
"items": {
"$ref": "#/definitions/NavigationBarButton"
},
"description": "Right button properties"
}
},
"required": [
"title"
]
}
},
"ern": {
"moduleName": "Counseling",
"moduleType": "ern-miniapp",
"version": "0.28.2"
}
}