|
@@ -413,6 +413,13 @@ def save_native_agent_configuration():
|
|
extra_params = req_data.get('extra_params', {})
|
|
extra_params = req_data.get('extra_params', {})
|
|
if isinstance(extra_params, dict):
|
|
if isinstance(extra_params, dict):
|
|
extra_params = json.dumps(extra_params)
|
|
extra_params = json.dumps(extra_params)
|
|
|
|
+ elif isinstance(extra_params, str):
|
|
|
|
+ try:
|
|
|
|
+ json.loads(extra_params)
|
|
|
|
+ except json.JSONDecodeError:
|
|
|
|
+ return wrap_response(400, msg='extra_params should be a valid JSON object or string')
|
|
|
|
+ if not extra_params:
|
|
|
|
+ extra_params = '{}'
|
|
|
|
|
|
if not name:
|
|
if not name:
|
|
return wrap_response(400, msg='name is required')
|
|
return wrap_response(400, msg='name is required')
|