Skip to content

fix(idp-extraction-connector): added custom deserialization for headers map#6945

Merged
reiballa merged 2 commits into
mainfrom
6935-fix-feel-serialization
Apr 14, 2026
Merged

fix(idp-extraction-connector): added custom deserialization for headers map#6945
reiballa merged 2 commits into
mainfrom
6935-fix-feel-serialization

Conversation

@reiballa
Copy link
Copy Markdown
Contributor

@reiballa reiballa commented Apr 13, 2026

Description

Fixes deserialization of [openAiHeaders](vscode-file://vscode-Fixes deserialization of openAiHeaders (Map<String, String>) in the IDP Extraction connector when FEEL evaluation is disabled for outbound connectors.

Since PR #6210 introduced a separate outboundConnectorObjectMapper with @feel processing disabled, Map-typed fields that arrive as JSON strings can no longer rely on the FeelDeserializer to coerce them. This caused a MismatchedInputException at runtime.

Testing:

  • Added StringToMapDeserializerTest to verify correct deserialization from both JSON objects and strings, and to ensure invalid inputs are properly rejected.

Related issues

closes #6935

Checklist

  • Backport labels are added if these code changes should be backported. No backport label is added to the latest
    release, as this branch will be rebased onto main before the next release. Example backport labels:
    • backport stable/8.8: for changes that should be included in the next 8.8.x release.
    • or backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and this
      release has already been created. The release branch will be merged back into stable/8.8 later, so the change
      will be included in future 8.8.x releases as well.
  • Tests/Integration tests for the changes have been added if applicable.
  • If the change requires a documentation update, it has been added to the appropriate section in the documentation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes runtime deserialization failures for openAiHeaders in the IDP Extraction connector when FEEL processing is disabled by introducing a custom Jackson deserializer that accepts either a JSON object or a JSON-encoded string.

Changes:

  • Added StringToMapDeserializer (and unit tests) to coerce Map<String, String> from either object or JSON-string inputs.
  • Applied the custom deserializer to openAiHeaders in both OpenAiRequest and OpenAiProvider.
  • Sanitized OpenAI custom header values before passing them to the underlying HTTP client/model builder.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
connectors/idp-extraction/src/main/java/io/camunda/connector/idp/extraction/jackson/StringToMapDeserializer.java New deserializer to support object-or-string map inputs for headers.
connectors/idp-extraction/src/test/java/io/camunda/connector/idp/extraction/jackson/StringToMapDeserializerTest.java Unit tests covering valid object/string inputs and invalid inputs.
connectors/idp-extraction/src/main/java/io/camunda/connector/idp/extraction/request/common/ai/OpenAiRequest.java Uses the new deserializer for openAiHeaders during variable binding.
connectors/idp-extraction/src/main/java/io/camunda/connector/idp/extraction/model/providers/OpenAiProvider.java Uses the new deserializer for provider-level openAiHeaders.
connectors/idp-extraction/src/main/java/io/camunda/connector/idp/extraction/client/ai/OpenAiClient.java Sanitizes header values prior to configuring the OpenAI chat model.

Copy link
Copy Markdown
Contributor

@steven-rg-harrison steven-rg-harrison left a comment

Choose a reason for hiding this comment

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

One minor comment, but not a blocker

@reiballa reiballa enabled auto-merge April 14, 2026 07:50
@reiballa reiballa added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit 472176a Apr 14, 2026
31 checks passed
@reiballa reiballa deleted the 6935-fix-feel-serialization branch April 14, 2026 08:16
@team-connectors-int-automation
Copy link
Copy Markdown
Contributor

team-connectors-int-automation Bot pushed a commit that referenced this pull request Apr 14, 2026
…rs map (#6945)

* fix(idp-extraction-connector): added custom deserialization for headers map

* fix(idp-extraction-connector): added suggestions

(cherry picked from commit 472176a)
reiballa added a commit that referenced this pull request Apr 15, 2026
…rs map (#6945) (#6948)

* fix(idp-extraction-connector): added custom deserialization for headers map

* fix(idp-extraction-connector): added suggestions

(cherry picked from commit 472176a)

Co-authored-by: Rei <rei.balla@camunda.com>
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This pull request has been included in release 8.9.1!

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the version:8.9.1 Released in version 8.9.1 label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This pull request has been included in release 8.10.0-alpha1!

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the version:8.10.0-alpha1 Released in version 8.10.0-alpha1 label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport stable/8.9 version:8.9.1 Released in version 8.9.1 version:8.10.0-alpha1 Released in version 8.10.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDP - FEEL annotation no longer works for outbound connectors, breaking string-to-map deserialization

3 participants