From 81e4ad2ce28155e91810e90e79476af8d017fbe6 Mon Sep 17 00:00:00 2001 From: ArturTomczak Date: Wed, 18 Sep 2024 13:42:31 +0200 Subject: [PATCH] handle numeric simpleValue (#5376) The input value can be a string or number, but 1.0 schema only accepts strings. The processing of int and float was missing. The casting to string might no longer be needed in IDS 1.1. https://github.com/buildingSMART/IDS/issues/342 --- src/ifctester/ifctester/facet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifctester/ifctester/facet.py b/src/ifctester/ifctester/facet.py index c5e9443916..e268b87d47 100644 --- a/src/ifctester/ifctester/facet.py +++ b/src/ifctester/ifctester/facet.py @@ -149,8 +149,8 @@ class Facet: return "This facet cannot be interpreted" def to_ids_value(self, parameter: Union[str, Restriction, list]) -> dict[str, Any]: - if isinstance(parameter, str): - parameter_dict = {"simpleValue": parameter} + if isinstance(parameter, (int, float, str)): + parameter_dict = {"simpleValue": str(parameter)} elif isinstance(parameter, Restriction): parameter_dict = {"xs:restriction": [parameter.asdict()]} elif isinstance(parameter, list):