Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-runtime"
version = "0.12.1"
version = "0.12.2"
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
6 changes: 6 additions & 0 deletions src/uipath/runtime/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class UiPathRuntimeSchema(BaseModel):
type: str = Field(..., alias="type")
input: dict[str, Any] = Field(..., alias="input")
output: dict[str, Any] = Field(..., alias="output")
is_transaction_root: bool | None = Field(
None,
alias="isTransactionRoot",
description="Whether this entrypoint is a transaction root "
"(set for vertical-solution projects)",
)
graph: UiPathRuntimeGraph | None = Field(
None, description="Runtime graph structure for debugging"
)
Expand Down
36 changes: 36 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pydantic import BaseModel

from uipath.runtime.schema import (
UiPathRuntimeSchema,
transform_attachments,
transform_nullable_types,
transform_references,
Expand Down Expand Up @@ -295,3 +296,38 @@ class TestModel(BaseModel):
}

assert result == expected


class TestUiPathRuntimeSchema:
def _make_schema(self, **kwargs: Any) -> UiPathRuntimeSchema:
return UiPathRuntimeSchema(
filePath="main.py",
uniqueId="00000000-0000-0000-0000-000000000001",
type="function",
input={},
output={},
**kwargs,
)

def test_is_transaction_root_omitted_when_unset(self):
"""Unset flag must not appear in the serialized entrypoint (bool? on consumers)."""
schema = self._make_schema()

dumped = schema.model_dump(by_alias=True, exclude_unset=True)

assert "isTransactionRoot" not in dumped

def test_is_transaction_root_serializes_by_alias(self):
"""The flag set via the python name serializes under its camelCase alias."""
schema = self._make_schema()
schema.is_transaction_root = True

dumped = schema.model_dump(by_alias=True, exclude_unset=True)

assert dumped["isTransactionRoot"] is True

def test_is_transaction_root_validates_from_alias(self):
"""The flag round-trips when read back from entry-points.json content."""
schema = self._make_schema(isTransactionRoot=True)

assert schema.is_transaction_root is True
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading