stoobly-agent 0.33.7__py3-none-any.whl → 0.34.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. stoobly_agent/__init__.py +1 -1
  2. stoobly_agent/app/cli/dev_tools_cli.py +1 -0
  3. stoobly_agent/app/cli/endpoint_cli.py +25 -2
  4. stoobly_agent/app/cli/helpers/endpoint_facade.py +22 -1
  5. stoobly_agent/app/cli/helpers/endpoints_import_context.py +57 -0
  6. stoobly_agent/app/cli/helpers/endpoints_import_service.py +152 -0
  7. stoobly_agent/app/cli/helpers/openapi_endpoint_adapter.py +111 -6
  8. stoobly_agent/app/cli/helpers/replay_facade.py +4 -0
  9. stoobly_agent/app/cli/request_cli.py +2 -0
  10. stoobly_agent/app/cli/scenario_cli.py +2 -0
  11. stoobly_agent/app/cli/types/test.py +2 -0
  12. stoobly_agent/app/models/factories/resource/local_db/helpers/request_builder.py +1 -1
  13. stoobly_agent/app/models/types/endpoint.py +28 -2
  14. stoobly_agent/app/proxy/handle_mock_service.py +15 -3
  15. stoobly_agent/app/proxy/intercept_settings.py +39 -0
  16. stoobly_agent/app/proxy/mock/eval_fixtures_service.py +61 -0
  17. stoobly_agent/app/proxy/mock/types/__init__.py +10 -0
  18. stoobly_agent/app/proxy/replay/replay_request_service.py +11 -3
  19. stoobly_agent/app/proxy/run.py +6 -0
  20. stoobly_agent/app/proxy/test/context.py +12 -0
  21. stoobly_agent/app/proxy/test/context_abc.py +15 -0
  22. stoobly_agent/app/settings/intercept_settings.py +1 -1
  23. stoobly_agent/cli.py +13 -2
  24. stoobly_agent/config/constants/custom_headers.py +2 -0
  25. stoobly_agent/config/constants/env_vars.py +2 -0
  26. stoobly_agent/lib/api/api.py +4 -0
  27. stoobly_agent/lib/api/body_param_names_resource.py +36 -0
  28. stoobly_agent/lib/api/endpoints_resource.py +9 -2
  29. stoobly_agent/lib/api/header_names_resource.py +36 -0
  30. stoobly_agent/lib/api/interfaces/endpoints.py +2 -0
  31. stoobly_agent/lib/api/query_param_names_resource.py +36 -0
  32. stoobly_agent/lib/api/response_header_names_resource.py +36 -0
  33. stoobly_agent/lib/api/response_param_names_resource.py +36 -0
  34. stoobly_agent/public/0-es2015.a7e60cafc0868f87a771.js +1 -0
  35. stoobly_agent/public/0-es5.a7e60cafc0868f87a771.js +1 -0
  36. stoobly_agent/public/1-es2015.cb071776436f10954db5.js +1 -0
  37. stoobly_agent/public/1-es5.cb071776436f10954db5.js +1 -0
  38. stoobly_agent/public/10-es2015.bb1702aaf3968a2cb521.js +1 -0
  39. stoobly_agent/public/10-es5.bb1702aaf3968a2cb521.js +1 -0
  40. stoobly_agent/public/12-es2015.591ec692afb8f8d13842.js +1 -0
  41. stoobly_agent/public/12-es5.591ec692afb8f8d13842.js +1 -0
  42. stoobly_agent/public/13-es2015.f381e7d6ff361b669e12.js +1 -0
  43. stoobly_agent/public/13-es5.f381e7d6ff361b669e12.js +1 -0
  44. stoobly_agent/public/14-es2015.1ffb225a16d6292dbddd.js +1 -0
  45. stoobly_agent/public/14-es5.1ffb225a16d6292dbddd.js +1 -0
  46. stoobly_agent/public/15-es2015.2cf39bcaeb0ea2c52297.js +1 -0
  47. stoobly_agent/public/15-es5.2cf39bcaeb0ea2c52297.js +1 -0
  48. stoobly_agent/public/16-es2015.0e9422b274e642f95e41.js +1 -0
  49. stoobly_agent/public/16-es5.0e9422b274e642f95e41.js +1 -0
  50. stoobly_agent/public/17-es2015.7fb08367a22d1e34aed7.js +1 -0
  51. stoobly_agent/public/17-es5.7fb08367a22d1e34aed7.js +1 -0
  52. stoobly_agent/public/18-es2015.5caa4789d1c335e628f2.js +1 -0
  53. stoobly_agent/public/18-es5.5caa4789d1c335e628f2.js +1 -0
  54. stoobly_agent/public/19-es2015.8049aef58c329c500f9b.js +1 -0
  55. stoobly_agent/public/19-es5.8049aef58c329c500f9b.js +1 -0
  56. stoobly_agent/public/2-es2015.8f184ac63348ba447b1f.js +1 -0
  57. stoobly_agent/public/2-es5.8f184ac63348ba447b1f.js +1 -0
  58. stoobly_agent/public/20-es2015.473486aabfa4d4a6431b.js +1 -0
  59. stoobly_agent/public/20-es5.473486aabfa4d4a6431b.js +1 -0
  60. stoobly_agent/public/21-es2015.63ed4e6b242fbc047bd6.js +1 -0
  61. stoobly_agent/public/21-es5.63ed4e6b242fbc047bd6.js +1 -0
  62. stoobly_agent/public/22-es2015.df183804415330639987.js +1 -0
  63. stoobly_agent/public/22-es5.df183804415330639987.js +1 -0
  64. stoobly_agent/public/23-es2015.0da63b056fabde91bb0b.js +1 -0
  65. stoobly_agent/public/23-es5.0da63b056fabde91bb0b.js +1 -0
  66. stoobly_agent/public/28-es2015.9fe030e9d3b0e52239aa.js +1 -0
  67. stoobly_agent/public/28-es5.9fe030e9d3b0e52239aa.js +1 -0
  68. stoobly_agent/public/29-es2015.9b440f22de725732e5ab.js +1 -0
  69. stoobly_agent/public/29-es5.9b440f22de725732e5ab.js +1 -0
  70. stoobly_agent/public/30-es2015.6ad2a5126b0a27c1e7c6.js +1 -0
  71. stoobly_agent/public/30-es5.6ad2a5126b0a27c1e7c6.js +1 -0
  72. stoobly_agent/public/31-es2015.f4291150f35d54ff19ca.js +1 -0
  73. stoobly_agent/public/31-es5.f4291150f35d54ff19ca.js +1 -0
  74. stoobly_agent/public/32-es2015.c8f6ccb43bdba0adf199.js +1 -0
  75. stoobly_agent/public/32-es5.c8f6ccb43bdba0adf199.js +1 -0
  76. stoobly_agent/public/33-es2015.f985e93402ebf86322ef.js +1 -0
  77. stoobly_agent/public/33-es5.f985e93402ebf86322ef.js +1 -0
  78. stoobly_agent/public/34-es2015.0e1961fb3cf649a52d49.js +1 -0
  79. stoobly_agent/public/34-es5.0e1961fb3cf649a52d49.js +1 -0
  80. stoobly_agent/public/35-es2015.a4ae56a89c0324397624.js +1 -0
  81. stoobly_agent/public/35-es5.a4ae56a89c0324397624.js +1 -0
  82. stoobly_agent/public/36-es2015.b8fdd25590a79c820119.js +1 -0
  83. stoobly_agent/public/36-es5.b8fdd25590a79c820119.js +1 -0
  84. stoobly_agent/public/37-es2015.6567a0ce4cf87ad7287b.js +1 -0
  85. stoobly_agent/public/37-es5.6567a0ce4cf87ad7287b.js +1 -0
  86. stoobly_agent/public/38-es2015.6f6d751bff41d84d727a.js +1 -0
  87. stoobly_agent/public/38-es5.6f6d751bff41d84d727a.js +1 -0
  88. stoobly_agent/public/39-es2015.47f63177e7d4509a22fa.js +1 -0
  89. stoobly_agent/public/39-es5.47f63177e7d4509a22fa.js +1 -0
  90. stoobly_agent/public/3rdpartylicenses.txt +2418 -0
  91. stoobly_agent/public/4-es2015.182e1ce1811ef67571fb.js +1 -0
  92. stoobly_agent/public/4-es5.182e1ce1811ef67571fb.js +1 -0
  93. stoobly_agent/public/40-es2015.5333067cdc4077c7495a.js +1 -0
  94. stoobly_agent/public/40-es5.5333067cdc4077c7495a.js +1 -0
  95. stoobly_agent/public/41-es2015.7a2434380c81c11ff2c5.js +1 -0
  96. stoobly_agent/public/41-es5.7a2434380c81c11ff2c5.js +1 -0
  97. stoobly_agent/public/42-es2015.5dde662fe1e3b4e4bdd1.js +1 -0
  98. stoobly_agent/public/42-es5.5dde662fe1e3b4e4bdd1.js +1 -0
  99. stoobly_agent/public/43-es2015.608e917d689b9bb762cb.js +1 -0
  100. stoobly_agent/public/43-es5.608e917d689b9bb762cb.js +1 -0
  101. stoobly_agent/public/44-es2015.2ae5fea15b5e8c2681d3.js +1 -0
  102. stoobly_agent/public/44-es5.2ae5fea15b5e8c2681d3.js +1 -0
  103. stoobly_agent/public/45-es2015.e46f228c795174428515.js +1 -0
  104. stoobly_agent/public/45-es5.e46f228c795174428515.js +1 -0
  105. stoobly_agent/public/46-es2015.22a0d8e0b4bbfb513741.js +1 -0
  106. stoobly_agent/public/46-es5.22a0d8e0b4bbfb513741.js +1 -0
  107. stoobly_agent/public/47-es2015.3878e5d1d692107748f3.js +1 -0
  108. stoobly_agent/public/47-es5.3878e5d1d692107748f3.js +1 -0
  109. stoobly_agent/public/5-es2015.aba7173be56fc19b4b6f.js +1 -0
  110. stoobly_agent/public/5-es5.aba7173be56fc19b4b6f.js +1 -0
  111. stoobly_agent/public/6-es2015.5fb726c0555664300974.js +1 -0
  112. stoobly_agent/public/6-es5.5fb726c0555664300974.js +1 -0
  113. stoobly_agent/public/7-es2015.9b9ab4adf24d13bdc2f8.js +1 -0
  114. stoobly_agent/public/7-es5.9b9ab4adf24d13bdc2f8.js +1 -0
  115. stoobly_agent/public/8-es2015.cdd7dce2a24aaf9d974f.js +1 -0
  116. stoobly_agent/public/8-es5.cdd7dce2a24aaf9d974f.js +1 -0
  117. stoobly_agent/public/9-es2015.cdde98f2537997afbf0f.js +1 -0
  118. stoobly_agent/public/9-es5.cdde98f2537997afbf0f.js +1 -0
  119. stoobly_agent/public/CHANGELOG.md +58 -0
  120. stoobly_agent/public/README.md +264 -0
  121. stoobly_agent/public/_redirects +1 -0
  122. stoobly_agent/public/assets/img/demo/1.jpg +0 -0
  123. stoobly_agent/public/assets/img/demo/2.jpg +0 -0
  124. stoobly_agent/public/assets/img/demo/3.jpg +0 -0
  125. stoobly_agent/public/assets/img/demo/4.jpg +0 -0
  126. stoobly_agent/public/assets/img/demo/5.jpg +0 -0
  127. stoobly_agent/public/assets/img/demo/6.jpg +0 -0
  128. stoobly_agent/public/assets/img/demo/7.jpg +0 -0
  129. stoobly_agent/public/assets/img/demo/8.jpg +0 -0
  130. stoobly_agent/public/assets/img/demo/landscape.jpg +0 -0
  131. stoobly_agent/public/assets/img/demo/mountain-cinematic.jpg +0 -0
  132. stoobly_agent/public/assets/img/illustrations/checklist.svg +164 -0
  133. stoobly_agent/public/assets/img/illustrations/data_center.svg +150 -0
  134. stoobly_agent/public/assets/img/illustrations/idea.svg +213 -0
  135. stoobly_agent/public/assets/img/illustrations/it_support.svg +168 -0
  136. stoobly_agent/public/assets/img/illustrations/peak_mountain_3.svg +262 -0
  137. stoobly_agent/public/assets/img/illustrations/under_constructions_1.svg +282 -0
  138. stoobly_agent/public/assets/img/logo/colored.png +0 -0
  139. stoobly_agent/public/assets/img/logo/colored.svg +9 -0
  140. stoobly_agent/public/assets/img/logo/white.png +0 -0
  141. stoobly_agent/public/assets/img/logo/white.svg +8 -0
  142. stoobly_agent/public/common-es2015.6f230354b12587f9be81.js +1 -0
  143. stoobly_agent/public/common-es5.6f230354b12587f9be81.js +1 -0
  144. stoobly_agent/public/favicon.ico +0 -0
  145. stoobly_agent/public/index.html +118 -0
  146. stoobly_agent/public/main-es2015.081bbd2709f22e95933e.js +1 -0
  147. stoobly_agent/public/main-es5.081bbd2709f22e95933e.js +1 -0
  148. stoobly_agent/public/polyfills-es2015.8ce2adc69f283f6c4c5e.js +1 -0
  149. stoobly_agent/public/polyfills-es5.7530172ddcec11a10eb3.js +1 -0
  150. stoobly_agent/public/runtime-es2015.362e49d383fb724f5414.js +1 -0
  151. stoobly_agent/public/runtime-es5.362e49d383fb724f5414.js +1 -0
  152. stoobly_agent/public/styles.ca104d947fbb2eebbeca.css +6 -0
  153. stoobly_agent/test/app/cli/helpers/openapi_endpoint_adapter_additional_props_test.py +34 -0
  154. stoobly_agent/test/app/cli/helpers/openapi_endpoint_adapter_missing_info_test.py +80 -3
  155. stoobly_agent/test/app/cli/helpers/openapi_endpoint_adapter_missing_oauth2_scopes_test.py +82 -1
  156. stoobly_agent/test/app/cli/helpers/openapi_endpoint_adapter_missing_servers_test.py +80 -3
  157. stoobly_agent/test/app/cli/helpers/openapi_endpoint_adapter_test.py +617 -4
  158. stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION +1 -1
  159. stoobly_agent/test/app/proxy/mock/eval_fixtures_service_test.py +95 -0
  160. {stoobly_agent-0.33.7.dist-info → stoobly_agent-0.34.1.dist-info}/METADATA +1 -1
  161. {stoobly_agent-0.33.7.dist-info → stoobly_agent-0.34.1.dist-info}/RECORD +164 -35
  162. {stoobly_agent-0.33.7.dist-info → stoobly_agent-0.34.1.dist-info}/LICENSE +0 -0
  163. {stoobly_agent-0.33.7.dist-info → stoobly_agent-0.34.1.dist-info}/WHEEL +0 -0
  164. {stoobly_agent-0.33.7.dist-info → stoobly_agent-0.34.1.dist-info}/entry_points.txt +0 -0
@@ -88,6 +88,81 @@ class TestOpenApiEndpointAdapter():
88
88
  'query': 'limit',
89
89
  'query_param_name_id': None,
90
90
  }
91
+ ],
92
+ 'path_segment_names': [
93
+ {
94
+ 'name': 'v2',
95
+ 'type': 'static'
96
+ },
97
+ {
98
+ 'name': 'pets',
99
+ 'type': 'static'
100
+ }
101
+ ],
102
+ 'response_param_names': [
103
+ {
104
+ 'endpoint_id': 1,
105
+ 'id': 1,
106
+ 'inferred_type': 'Hash',
107
+ 'is_required': False,
108
+ 'name': 'Element',
109
+ 'query': '[*]',
110
+ 'response_param_name_id': None
111
+ },
112
+ {
113
+ 'endpoint_id': 1,
114
+ 'id': 2,
115
+ 'inferred_type': 'String',
116
+ 'is_deterministic': True,
117
+ 'is_required': True,
118
+ 'name': 'name',
119
+ 'query': '[*].name',
120
+ 'response_param_name_id': 1,
121
+ 'values': ['']
122
+ },
123
+ {
124
+ 'endpoint_id': 1,
125
+ 'id': 3,
126
+ 'inferred_type': 'String',
127
+ 'is_deterministic': True,
128
+ 'is_required': False,
129
+ 'name': 'tag',
130
+ 'query': '[*].tag',
131
+ 'response_param_name_id': 1
132
+ },
133
+ {
134
+ 'endpoint_id': 1,
135
+ 'id': 4,
136
+ 'inferred_type': 'Integer',
137
+ 'is_deterministic': True,
138
+ 'is_required': True,
139
+ 'name': 'id',
140
+ 'query': '[*].id',
141
+ 'response_param_name_id': 1,
142
+ 'values': [0]
143
+ },
144
+ {
145
+ 'endpoint_id': 1,
146
+ 'id': 1,
147
+ 'inferred_type': 'Integer',
148
+ 'is_deterministic': True,
149
+ 'is_required': True,
150
+ 'name': 'code',
151
+ 'query': 'code',
152
+ 'response_param_name_id': None,
153
+ 'values': [0]
154
+ },
155
+ {
156
+ 'endpoint_id': 1,
157
+ 'id': 2,
158
+ 'inferred_type': 'String',
159
+ 'is_deterministic': True,
160
+ 'is_required': True,
161
+ 'name': 'message',
162
+ 'query': 'message',
163
+ 'response_param_name_id': None,
164
+ 'values': ['']
165
+ }
91
166
  ]
92
167
  }
93
168
 
@@ -123,6 +198,72 @@ class TestOpenApiEndpointAdapter():
123
198
  'query': 'tag',
124
199
  },
125
200
  ],
201
+ 'path_segment_names': [
202
+ {
203
+ 'name': 'v2',
204
+ 'type': 'static',
205
+ },
206
+ {
207
+ 'name': 'pets',
208
+ 'type': 'static',
209
+ },
210
+ ],
211
+ 'response_param_names': [
212
+ {
213
+ 'endpoint_id': 2,
214
+ 'id': 1,
215
+ 'inferred_type': 'String',
216
+ 'is_deterministic': True,
217
+ 'is_required': True,
218
+ 'name': 'name',
219
+ 'query': 'name',
220
+ 'response_param_name_id': None,
221
+ 'values': [''],
222
+ },
223
+ {
224
+ 'endpoint_id': 2,
225
+ 'id': 2,
226
+ 'inferred_type': 'String',
227
+ 'is_deterministic': True,
228
+ 'is_required': False,
229
+ 'name': 'tag',
230
+ 'query': 'tag',
231
+ 'response_param_name_id': None,
232
+ },
233
+ {
234
+ 'endpoint_id': 2,
235
+ 'id': 3,
236
+ 'inferred_type': 'Integer',
237
+ 'is_deterministic': True,
238
+ 'is_required': True,
239
+ 'name': 'id',
240
+ 'query': 'id',
241
+ 'response_param_name_id': None,
242
+ 'values': [0],
243
+ },
244
+ {
245
+ 'endpoint_id': 2,
246
+ 'id': 1,
247
+ 'inferred_type': 'Integer',
248
+ 'is_deterministic': True,
249
+ 'is_required': True,
250
+ 'name': 'code',
251
+ 'query': 'code',
252
+ 'response_param_name_id': None,
253
+ 'values': [0],
254
+ },
255
+ {
256
+ 'endpoint_id': 2,
257
+ 'id': 2,
258
+ 'inferred_type': 'String',
259
+ 'is_deterministic': True,
260
+ 'is_required': True,
261
+ 'name': 'message',
262
+ 'query': 'message',
263
+ 'response_param_name_id': None,
264
+ 'values': [''],
265
+ },
266
+ ],
126
267
  }
127
268
 
128
269
  @pytest.fixture(scope='class')
@@ -135,6 +276,76 @@ class TestOpenApiEndpointAdapter():
135
276
  'path': '/v2/pets/{id}',
136
277
  'match_pattern': '/v2/pets/%',
137
278
  'aliases': [{'id': 1, 'name': '{id}'}],
279
+ 'path_segment_names': [
280
+ {
281
+ 'name': 'v2',
282
+ 'type': 'static',
283
+ },
284
+ {
285
+ 'name': 'pets',
286
+ 'type': 'static',
287
+ },
288
+ {
289
+ 'name': ':id',
290
+ 'type': 'alias',
291
+ },
292
+ ],
293
+ 'response_param_names': [
294
+ {
295
+ 'endpoint_id': 3,
296
+ 'id': 1,
297
+ 'inferred_type': 'String',
298
+ 'is_deterministic': True,
299
+ 'is_required': True,
300
+ 'name': 'name',
301
+ 'query': 'name',
302
+ 'response_param_name_id': None,
303
+ 'values': [''],
304
+ },
305
+ {
306
+ 'endpoint_id': 3,
307
+ 'id': 2,
308
+ 'inferred_type': 'String',
309
+ 'is_deterministic': True,
310
+ 'is_required': False,
311
+ 'name': 'tag',
312
+ 'query': 'tag',
313
+ 'response_param_name_id': None,
314
+ },
315
+ {
316
+ 'endpoint_id': 3,
317
+ 'id': 3,
318
+ 'inferred_type': 'Integer',
319
+ 'is_deterministic': True,
320
+ 'is_required': True,
321
+ 'name': 'id',
322
+ 'query': 'id',
323
+ 'response_param_name_id': None,
324
+ 'values': [0],
325
+ },
326
+ {
327
+ 'endpoint_id': 3,
328
+ 'id': 1,
329
+ 'inferred_type': 'Integer',
330
+ 'is_deterministic': True,
331
+ 'is_required': True,
332
+ 'name': 'code',
333
+ 'query': 'code',
334
+ 'response_param_name_id': None,
335
+ 'values': [0],
336
+ },
337
+ {
338
+ 'endpoint_id': 3,
339
+ 'id': 2,
340
+ 'inferred_type': 'String',
341
+ 'is_deterministic': True,
342
+ 'is_required': True,
343
+ 'name': 'message',
344
+ 'query': 'message',
345
+ 'response_param_name_id': None,
346
+ 'values': [''],
347
+ },
348
+ ],
138
349
  }
139
350
 
140
351
  @pytest.fixture(scope='class')
@@ -147,6 +358,44 @@ class TestOpenApiEndpointAdapter():
147
358
  'match_pattern': '/v2/pets/%',
148
359
  'port': '443',
149
360
  'aliases': [{'id': 1, 'name': '{id}'}],
361
+ 'path_segment_names': [
362
+ {
363
+ 'name': 'v2',
364
+ 'type': 'static',
365
+ },
366
+ {
367
+ 'name': 'pets',
368
+ 'type': 'static',
369
+ },
370
+ {
371
+ 'name': ':id',
372
+ 'type': 'alias',
373
+ },
374
+ ],
375
+ 'response_param_names': [
376
+ {
377
+ 'endpoint_id': 4,
378
+ 'id': 1,
379
+ 'inferred_type': 'Integer',
380
+ 'is_deterministic': True,
381
+ 'is_required': True,
382
+ 'name': 'code',
383
+ 'query': 'code',
384
+ 'response_param_name_id': None,
385
+ 'values': [0],
386
+ },
387
+ {
388
+ 'endpoint_id': 4,
389
+ 'id': 2,
390
+ 'inferred_type': 'String',
391
+ 'is_deterministic': True,
392
+ 'is_required': True,
393
+ 'name': 'message',
394
+ 'query': 'message',
395
+ 'response_param_name_id': None,
396
+ 'values': [''],
397
+ },
398
+ ],
150
399
  }
151
400
 
152
401
  def test_adapt_from_file(self, open_api_endpoint_adapter, petstore_expanded_file_path, expected_v2_get_pets_endpoint, expected_v2_post_pets_endpoint, expected_v2_get_pets_id_endpoint, expected_v2_delete_pets_id_endpoint):
@@ -179,6 +428,34 @@ class TestOpenApiEndpointAdapter():
179
428
  'port': '443',
180
429
  'path': '/ds-api/',
181
430
  'match_pattern': '/ds-api/',
431
+ 'path_segment_names': [
432
+ {
433
+ 'name': 'ds-api',
434
+ 'type': 'static',
435
+ },
436
+ ],
437
+ 'response_param_names': [
438
+ {
439
+ 'endpoint_id': 1,
440
+ 'id': 1,
441
+ 'inferred_type': 'Integer',
442
+ 'is_deterministic': True,
443
+ 'is_required': False,
444
+ 'name': 'total',
445
+ 'query': 'total',
446
+ 'response_param_name_id': None,
447
+ },
448
+ {
449
+ 'endpoint_id': 1,
450
+ 'id': 2,
451
+ 'inferred_type': 'Array',
452
+ 'is_deterministic': True,
453
+ 'is_required': False,
454
+ 'name': 'apis',
455
+ 'query': 'apis',
456
+ 'response_param_name_id': None,
457
+ },
458
+ ],
182
459
  }
183
460
 
184
461
  @pytest.fixture(scope='class')
@@ -186,6 +463,8 @@ class TestOpenApiEndpointAdapter():
186
463
  http_endpoint_version = copy.deepcopy(expected_get_root_https)
187
464
  http_endpoint_version['id'] = 4
188
465
  http_endpoint_version['port'] = '80'
466
+ for response_param_name in http_endpoint_version['response_param_names']:
467
+ response_param_name['endpoint_id'] = 4
189
468
  return http_endpoint_version
190
469
 
191
470
  @pytest.fixture(scope='class')
@@ -198,6 +477,24 @@ class TestOpenApiEndpointAdapter():
198
477
  'match_pattern': '/ds-api/%/%/fields',
199
478
  'path': '/ds-api/{dataset}/{version}/fields',
200
479
  'aliases': [{'id': 1, 'name': '{dataset}'}, {'id': 2, 'name': '{version}'}],
480
+ 'path_segment_names': [
481
+ {
482
+ 'name': 'ds-api',
483
+ 'type': 'static',
484
+ },
485
+ {
486
+ 'name': ':dataset',
487
+ 'type': 'alias',
488
+ },
489
+ {
490
+ 'name': ':version',
491
+ 'type': 'alias',
492
+ },
493
+ {
494
+ 'name': 'fields',
495
+ 'type': 'static',
496
+ },
497
+ ],
201
498
  }
202
499
 
203
500
  @pytest.fixture(scope='class')
@@ -250,6 +547,24 @@ class TestOpenApiEndpointAdapter():
250
547
  'query': 'rows',
251
548
  }
252
549
  ],
550
+ 'path_segment_names': [
551
+ {
552
+ 'name': 'ds-api',
553
+ 'type': 'static',
554
+ },
555
+ {
556
+ 'name': ':dataset',
557
+ 'type': 'alias',
558
+ },
559
+ {
560
+ 'name': ':version',
561
+ 'type': 'alias',
562
+ },
563
+ {
564
+ 'name': 'records',
565
+ 'type': 'static',
566
+ },
567
+ ],
253
568
  }
254
569
 
255
570
  @pytest.fixture(scope='class')
@@ -383,6 +698,40 @@ class TestOpenApiEndpointAdapter():
383
698
  'values': [0],
384
699
  },
385
700
  ],
701
+ 'path_segment_names': [
702
+ {
703
+ 'name': 'v1',
704
+ 'type': 'static',
705
+ },
706
+ {
707
+ 'name': 'pets',
708
+ 'type': 'static',
709
+ },
710
+ ],
711
+ 'response_param_names': [
712
+ {
713
+ 'endpoint_id': 1,
714
+ 'id': 1,
715
+ 'inferred_type': 'Integer',
716
+ 'is_deterministic': True,
717
+ 'is_required': True,
718
+ 'name': 'code',
719
+ 'query': 'code',
720
+ 'response_param_name_id': None,
721
+ 'values': [0],
722
+ },
723
+ {
724
+ 'endpoint_id': 1,
725
+ 'id': 2,
726
+ 'inferred_type': 'String',
727
+ 'is_deterministic': True,
728
+ 'is_required': True,
729
+ 'name': 'message',
730
+ 'query': 'message',
731
+ 'response_param_name_id': None,
732
+ 'values': [''],
733
+ },
734
+ ],
386
735
  }
387
736
 
388
737
  @pytest.fixture(scope='class')
@@ -500,6 +849,41 @@ class TestOpenApiEndpointAdapter():
500
849
  'query': 'id',
501
850
  'values': [0]}
502
851
  ],
852
+ 'path_segment_names': [
853
+ {
854
+ 'name': 'v2',
855
+ 'type': 'static',
856
+ },
857
+ {
858
+ 'name': 'pets',
859
+ 'type': 'static',
860
+ },
861
+ ],
862
+ 'response_param_names': [
863
+ {
864
+ 'endpoint_id': 2,
865
+ 'id': 1,
866
+ 'inferred_type': 'Integer',
867
+ 'is_deterministic': True,
868
+ 'is_required': True,
869
+ 'name': 'code',
870
+ 'query': 'code',
871
+ 'response_param_name_id': None,
872
+ 'values': [0],
873
+ },
874
+ {
875
+ 'endpoint_id': 2,
876
+ 'id': 2,
877
+ 'inferred_type': 'String',
878
+ 'is_deterministic': True,
879
+ 'is_required': True,
880
+ 'name': 'message',
881
+ 'query': 'message',
882
+ 'response_param_name_id': None,
883
+ 'values': [''],
884
+ },
885
+ ],
886
+
503
887
  }
504
888
 
505
889
  def test_adapt_from_file(self, open_api_endpoint_adapter, petstore_references_file_path, expected_get_v1_pets_ref, expected_get_v2_pets_ref):
@@ -521,12 +905,12 @@ class TestOpenApiEndpointAdapter():
521
905
  @pytest.fixture(scope='class')
522
906
  def expected_put_v3_pets_ref(self) -> Dict:
523
907
  return {
524
- 'host': '',
908
+ 'host': '-',
525
909
  'id': 1,
526
910
  'match_pattern': '/v3/pet',
527
911
  'method': 'PUT',
528
912
  'path': '/v3/pet',
529
- 'port': '',
913
+ 'port': '0',
530
914
  'body_param_names': [
531
915
  {
532
916
  'body_param_name_id': None,
@@ -649,17 +1033,149 @@ class TestOpenApiEndpointAdapter():
649
1033
  'query': 'status'
650
1034
  },
651
1035
  ],
1036
+ 'path_segment_names': [
1037
+ {
1038
+ 'name': 'v3',
1039
+ 'type': 'static',
1040
+ },
1041
+ {
1042
+ 'name': 'pet',
1043
+ 'type': 'static',
1044
+ },
1045
+ ],
1046
+ 'response_param_names': [
1047
+ {
1048
+ 'endpoint_id': 1,
1049
+ 'id': 1,
1050
+ 'inferred_type': 'Integer',
1051
+ 'is_deterministic': True,
1052
+ 'is_required': False,
1053
+ 'name': 'id',
1054
+ 'query': 'id',
1055
+ 'response_param_name_id': None,
1056
+ },
1057
+ {
1058
+ 'endpoint_id': 1,
1059
+ 'id': 2,
1060
+ 'inferred_type': 'String',
1061
+ 'is_deterministic': True,
1062
+ 'is_required': True,
1063
+ 'name': 'name',
1064
+ 'query': 'name',
1065
+ 'response_param_name_id': None,
1066
+ 'values': [''],
1067
+ },
1068
+ {
1069
+ 'endpoint_id': 1,
1070
+ 'id': 3,
1071
+ 'inferred_type': 'Hash',
1072
+ 'is_deterministic': True,
1073
+ 'is_required': False,
1074
+ 'name': 'category',
1075
+ 'query': 'category',
1076
+ 'response_param_name_id': None,
1077
+ },
1078
+ {
1079
+ 'endpoint_id': 1,
1080
+ 'id': 4,
1081
+ 'inferred_type': 'Integer',
1082
+ 'is_deterministic': True,
1083
+ 'is_required': False,
1084
+ 'name': 'id',
1085
+ 'query': 'category.id',
1086
+ 'response_param_name_id': 3,
1087
+ },
1088
+ {
1089
+ 'endpoint_id': 1,
1090
+ 'id': 5,
1091
+ 'inferred_type': 'String',
1092
+ 'is_deterministic': True,
1093
+ 'is_required': False,
1094
+ 'name': 'name',
1095
+ 'query': 'category.name',
1096
+ 'response_param_name_id': 3,
1097
+ },
1098
+ {
1099
+ 'endpoint_id': 1,
1100
+ 'id': 6,
1101
+ 'inferred_type': 'Array',
1102
+ 'is_deterministic': True,
1103
+ 'is_required': True,
1104
+ 'name': 'photoUrls',
1105
+ 'query': 'photoUrls',
1106
+ 'response_param_name_id': None,
1107
+ 'values': [[]],
1108
+ },
1109
+ {
1110
+ 'endpoint_id': 1,
1111
+ 'id': 7,
1112
+ 'inferred_type': 'String',
1113
+ 'is_required': False,
1114
+ 'name': 'PhotourlsElement',
1115
+ 'query': 'photoUrls[*]',
1116
+ 'response_param_name_id': 6,
1117
+ },
1118
+ {
1119
+ 'endpoint_id': 1,
1120
+ 'id': 8,
1121
+ 'inferred_type': 'Array',
1122
+ 'is_deterministic': True,
1123
+ 'is_required': False,
1124
+ 'name': 'tags',
1125
+ 'query': 'tags',
1126
+ 'response_param_name_id': None,
1127
+ },
1128
+ {
1129
+ 'endpoint_id': 1,
1130
+ 'id': 9,
1131
+ 'inferred_type': 'Hash',
1132
+ 'is_required': False,
1133
+ 'name': 'TagsElement',
1134
+ 'query': 'tags[*]',
1135
+ 'response_param_name_id': 8,
1136
+ },
1137
+ {
1138
+ 'endpoint_id': 1,
1139
+ 'id': 10,
1140
+ 'inferred_type': 'Integer',
1141
+ 'is_deterministic': True,
1142
+ 'is_required': False,
1143
+ 'name': 'id',
1144
+ 'query': 'tags[*].id',
1145
+ 'response_param_name_id': 9,
1146
+ },
1147
+ {
1148
+ 'endpoint_id': 1,
1149
+ 'id': 11,
1150
+ 'inferred_type': 'String',
1151
+ 'is_deterministic': True,
1152
+ 'is_required': False,
1153
+ 'name': 'name',
1154
+ 'query': 'tags[*].name',
1155
+ 'response_param_name_id': 9,
1156
+ },
1157
+ {
1158
+ 'endpoint_id': 1,
1159
+ 'id': 12,
1160
+ 'inferred_type': 'String',
1161
+ 'is_deterministic': True,
1162
+ 'is_required': False,
1163
+ 'name': 'status',
1164
+ 'query': 'status',
1165
+ 'response_param_name_id': None,
1166
+ },
1167
+ ],
652
1168
  }
653
1169
 
654
1170
  @pytest.fixture(scope='class')
655
1171
  def expected_post_v3_user_createwithlist(self) -> Dict:
656
1172
  return {
657
- 'host': '',
1173
+ 'host': '-',
658
1174
  'id': 14,
659
1175
  'match_pattern': '/v3/user/createWithList',
660
1176
  'method': 'POST',
661
1177
  'path': '/v3/user/createWithList',
662
- 'port': '',
1178
+ 'port': '0',
663
1179
  'body_param_names': [
664
1180
  {
665
1181
  'body_param_name_id': None,
@@ -751,6 +1267,103 @@ class TestOpenApiEndpointAdapter():
751
1267
  'query': '[*].userStatus'
752
1268
  }
753
1269
  ],
1270
+ 'path_segment_names': [
1271
+ {
1272
+ 'name': 'v3',
1273
+ 'type': 'static',
1274
+ },
1275
+ {
1276
+ 'name': 'user',
1277
+ 'type': 'static',
1278
+ },
1279
+ {
1280
+ 'name': 'createWithList',
1281
+ 'type': 'static',
1282
+ },
1283
+ ],
1284
+ 'response_param_names': [
1285
+ {
1286
+ 'endpoint_id': 14,
1287
+ 'id': 1,
1288
+ 'inferred_type': 'Integer',
1289
+ 'is_deterministic': True,
1290
+ 'is_required': False,
1291
+ 'name': 'id',
1292
+ 'query': 'id',
1293
+ 'response_param_name_id': None,
1294
+ },
1295
+ {
1296
+ 'endpoint_id': 14,
1297
+ 'id': 2,
1298
+ 'inferred_type': 'String',
1299
+ 'is_deterministic': True,
1300
+ 'is_required': False,
1301
+ 'name': 'username',
1302
+ 'query': 'username',
1303
+ 'response_param_name_id': None,
1304
+ },
1305
+ {
1306
+ 'endpoint_id': 14,
1307
+ 'id': 3,
1308
+ 'inferred_type': 'String',
1309
+ 'is_deterministic': True,
1310
+ 'is_required': False,
1311
+ 'name': 'firstName',
1312
+ 'query': 'firstName',
1313
+ 'response_param_name_id': None,
1314
+ },
1315
+ {
1316
+ 'endpoint_id': 14,
1317
+ 'id': 4,
1318
+ 'inferred_type': 'String',
1319
+ 'is_deterministic': True,
1320
+ 'is_required': False,
1321
+ 'name': 'lastName',
1322
+ 'query': 'lastName',
1323
+ 'response_param_name_id': None,
1324
+ },
1325
+ {
1326
+ 'endpoint_id': 14,
1327
+ 'id': 5,
1328
+ 'inferred_type': 'String',
1329
+ 'is_deterministic': True,
1330
+ 'is_required': False,
1331
+ 'name': 'email',
1332
+ 'query': 'email',
1333
+ 'response_param_name_id': None,
1334
+ },
1335
+ {
1336
+ 'endpoint_id': 14,
1337
+ 'id': 6,
1338
+ 'inferred_type': 'String',
1339
+ 'is_deterministic': True,
1340
+ 'is_required': False,
1341
+ 'name': 'password',
1342
+ 'query': 'password',
1343
+ 'response_param_name_id': None,
1344
+ },
1345
+ {
1346
+ 'endpoint_id': 14,
1347
+ 'id': 7,
1348
+ 'inferred_type': 'String',
1349
+ 'is_deterministic': True,
1350
+ 'is_required': False,
1351
+ 'name': 'phone',
1352
+ 'query': 'phone',
1353
+ 'response_param_name_id': None,
1354
+ },
1355
+ {
1356
+ 'endpoint_id': 14,
1357
+ 'id': 8,
1358
+ 'inferred_type': 'Integer',
1359
+ 'is_deterministic': True,
1360
+ 'is_required': False,
1361
+ 'name': 'userStatus',
1362
+ 'query': 'userStatus',
1363
+ 'response_param_name_id': None,
1364
+ },
1365
+ ],
1366
+
754
1367
  }
755
1368
 
756
1369
  def test_adapt_from_file(self, open_api_endpoint_adapter, petstore_swagger_io_file_path, expected_put_v3_pets_ref, expected_post_v3_user_createwithlist):