diff --git a/app/parameters.py b/app/parameters.py index d9d6280..4710e08 100644 --- a/app/parameters.py +++ b/app/parameters.py @@ -16,13 +16,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # ****************************************************************************** +import json class ParameterDictionary(dict): """ Definition of supported parameter types """ - __parameter_types = {"String": str, "Integer": int, "Float": float, "Unknown": str, "Array": list} + __parameter_types = {"String": str, "Integer": int, "Float": float, "Unknown": str, "Array": list, + "FloatArray": list} """ Converts a given parameter type definition pair to a parameter of the defined type. @@ -38,9 +40,13 @@ def __convert_to_typed_parameter(cls, parameter): return None try: - t = ParameterDictionary.__parameter_types[parameter['type']] - value = parameter['rawValue'] - return t(value) + if parameter["type"] == "FloatArray": + value = json.loads(parameter['rawValue']) + return value + else: + t = ParameterDictionary.__parameter_types[parameter['type']] + value = parameter['rawValue'] + return t(value) except: return None