Skip to content

Commit 92c303a

Browse files
authored
Merge pull request #13 from UiPath/fix/mock_schame
fix: mock generic schema
2 parents a94a4bd + 28c7210 commit 92c303a

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-dev"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
description = "UiPath Developer Console"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/dev/ui/panels/new_run_panel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def _mock_value(sub_schema: dict[str, Any], required: bool = True) -> Any:
3434

3535
# 3) Objects: recurse into mock_json_from_schema
3636
if t == "object":
37+
if "properties" not in sub_schema:
38+
return {}
3739
return mock_json_from_schema(sub_schema)
3840

3941
# 4) Arrays: mock a single item based on "items" schema
@@ -62,7 +64,10 @@ def _mock_value(sub_schema: dict[str, Any], required: bool = True) -> Any:
6264
return None
6365

6466
# Top-level: if it's an object with properties, build a dict
65-
if schema.get("type") == "object" and "properties" in schema:
67+
if schema.get("type") == "object":
68+
if "properties" not in schema:
69+
return {}
70+
6671
props: dict[str, Any] = schema.get("properties", {})
6772
required_keys = set(schema.get("required", []))
6873
result: dict[str, Any] = {}

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)