Skip to content

fix(functions): serialize function output by its field aliases - #1927

Open
radu-mocanu wants to merge 1 commit into
mainfrom
fix/function-output-aliases
Open

radu-mocanu wants to merge 1 commit into
mainfrom
fix/function-output-aliases

Conversation

@radu-mocanu

Copy link
Copy Markdown
Collaborator

Summary

  • a coded function that returns a pydantic model now emits it under the field aliases its output schema declares, so an Attachment comes back as ID / FullName / MimeType instead of id / full_name / mime_type
  • models without aliases serialize exactly as before

Why

the generated output schema uses each field's alias while the runtime dumped field names, so a function's output did not match its own schema. an agent passing a returned file to another tool failed that tool's validation (ID required).

Copilot AI balanced review requested due to automatic review settings October 3, 2026 20:28
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Oct 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation resolves the schema mismatch and includes focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns coded-function Pydantic output serialization with generated schemas by emitting field aliases.

Changes:

  • Serializes Pydantic outputs with by_alias=True.
  • Adds coverage for aliased, nested, and unaliased models.
  • Bumps the package patch version.
File Description
packages/​uipath/​src/​uipath/​functions/​type_conversion.py Enables alias-based model serialization.
packages/​uipath/​tests/​functions/​test_output_serialization.py Verifies output serialization behavior.
packages/​uipath/​pyproject.toml Bumps version to 2.14.33.
packages/​uipath/​uv.lock Synchronizes the locked package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants