Skip to content

Commit 134d381

Browse files
committed
fix: 🐛 endpoint with no parameter skipped incorrectly
1 parent a423177 commit 134d381

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/monitor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
API Uptime Monitor
3-
3+
44
Author:
55
Kevin Xin
66
Amiteshk Sharma
@@ -124,12 +124,12 @@ def test_endpoint(self, _endpoint, _endpoint_info):
124124
'components': self.components}
125125
if 'get' in _endpoint_info:
126126
endpoint_doc['method'] = 'GET'
127-
endpoint_doc['params'] = _endpoint_info.get('get').get('parameters')
127+
endpoint_doc['params'] = _endpoint_info.get('get').get('parameters', {})
128128
elif 'post' in _endpoint_info:
129129
endpoint_doc['method'] = 'POST'
130130
endpoint_doc['params'] = _endpoint_info.get('post').get('parameters')
131131
endpoint_doc['requestbody'] = _endpoint_info['post'].get('requestBody')
132-
if endpoint_doc.get('params') or endpoint_doc.get('requestbody'):
132+
if 'params' in endpoint_doc or endpoint_doc.get('requestbody'):
133133
endpoint = Endpoint(endpoint_doc)
134134
try:
135135
response = endpoint.make_api_call()
@@ -247,7 +247,7 @@ def make_api_call(self):
247247
# parameter in query
248248
elif _param['in'] == 'query':
249249
params = {_param['name']: _param['example']}
250-
250+
251251
elif 'required' in _param and _param['required'] is True:
252252
paramsRequired = True
253253
# check required params

0 commit comments

Comments
 (0)