Skip to content

Commit

Permalink
handle numeric simpleValue
Browse files Browse the repository at this point in the history
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. buildingSMART/IDS#342
  • Loading branch information
atomczak authored Sep 12, 2024
1 parent 2545769 commit d862e80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ifctester/ifctester/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def to_string(
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):
Expand Down

0 comments on commit d862e80

Please sign in to comment.