fix(idp-extraction-connector): added custom deserialization for headers map#6945
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 coerceMap<String, String>from either object or JSON-string inputs. - Applied the custom deserializer to
openAiHeadersin bothOpenAiRequestandOpenAiProvider. - 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. |
steven-rg-harrison
approved these changes
Apr 13, 2026
Contributor
steven-rg-harrison
left a comment
There was a problem hiding this comment.
One minor comment, but not a blocker
Contributor
|
Successfully created backport PR for |
Contributor
|
🎉 This pull request has been included in release Thank you for your contribution! 🚀 |
Contributor
|
🎉 This pull request has been included in release Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@feelprocessing disabled, Map-typed fields that arrive as JSON strings can no longer rely on theFeelDeserializerto coerce them. This caused aMismatchedInputExceptionat runtime.Testing:
StringToMapDeserializerTestto verify correct deserialization from both JSON objects and strings, and to ensure invalid inputs are properly rejected.Related issues
closes #6935
Checklist
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.backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and thisrelease 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.