Skip to content

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

Merged
radu-mocanu merged 1 commit into
mainfrom
fix/function-output-aliases
Oct 5, 2026
Merged

radu-mocanu merged 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.

@radu-mocanu
radu-mocanu force-pushed the fix/function-output-aliases branch from 2b0e1d5 to 38ff5fd Compare October 5, 2026 08:01
@radu-mocanu
radu-mocanu enabled auto-merge (squash) October 5, 2026 08:01
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit 12ba424 into main Oct 5, 2026
186 of 187 checks passed
@radu-mocanu
radu-mocanu deleted the fix/function-output-aliases branch October 5, 2026 08:11
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants