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
This commit is contained in:
ArturTomczak
2024-09-18 13:42:31 +02:00
committed by GitHub
parent 736d91f38e
commit 81e4ad2ce2
+2 -2
View File
@@ -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):