summaryrefslogtreecommitdiff
path: root/opendc/util
diff options
context:
space:
mode:
Diffstat (limited to 'opendc/util')
-rw-r--r--opendc/util/parameter_checker.py2
-rw-r--r--opendc/util/rest.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/opendc/util/parameter_checker.py b/opendc/util/parameter_checker.py
index bf02ba9b..f55e780e 100644
--- a/opendc/util/parameter_checker.py
+++ b/opendc/util/parameter_checker.py
@@ -48,7 +48,7 @@ def _incorrect_parameter(params_required, params_actual, parent=''):
if param_required == 'int' and not isinstance(param_actual, int):
return '{}.{}'.format(parent, param_name)
- if param_required == 'string' and not isinstance(param_actual, str):
+ if param_required == 'string' and not isinstance(param_actual, str) and not isinstance(param_actual, int):
return '{}.{}'.format(parent, param_name)
if param_required.startswith('list') and not isinstance(param_actual, list):
diff --git a/opendc/util/rest.py b/opendc/util/rest.py
index 4da2ced6..2f2e1b53 100644
--- a/opendc/util/rest.py
+++ b/opendc/util/rest.py
@@ -41,7 +41,7 @@ class Request(object):
self.path = message['path'].strip('/')
module_base = 'opendc.api.{}.endpoint'
- module_path = self.path.replace('/', '.')
+ module_path = self.path.replace('{', '').replace('}', '').replace('/', '.')
self.module = importlib.import_module(module_base.format(module_path))
except ImportError: