Skip to content

Conversation

@rogin
Copy link
Contributor

@rogin rogin commented Jul 3, 2025

Fixes issue where query parameters on an HTTP Sender Connector are not sent in order.

Apart from the included unit test, I have not verified this solution on my local machine.

Related
Original ticket - nextgenhealthcare/connect#6276
Previous PR - nextgenhealthcare/connect#6296
Summary table in #121

@rogin rogin force-pushed the preserve-http-parameter-order branch from a2e7a6b to abfeb65 Compare July 4, 2025 01:49
@rogin rogin force-pushed the preserve-http-parameter-order branch from abfeb65 to ee8719d Compare July 23, 2025 03:59
@pacmano1 pacmano1 self-requested a review August 30, 2025 17:18
Copy link

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

This PR fixes an issue where HTTP query parameters were not being sent in the order they were defined when using a map variable. The fix changes HttpUtil.getTableMap() to use LinkedHashMap instead of HashMap to preserve insertion order, which is important for APIs that expect parameters in a specific sequence.

Key Changes:

  • Modified HttpUtil.getTableMap() to return a LinkedHashMap instead of HashMap to preserve parameter order
  • Added a unit test testMapOrderPreserved() to verify that map key order is maintained when retrieving table maps

Reviewed changes

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

File Description
server/src/com/mirth/connect/util/HttpUtil.java Changed HashMap to LinkedHashMap in getTableMap method to preserve insertion order of HTTP parameters
server/test/com/mirth/connect/util/HttpUtilTest.java Added test case to verify that key order is preserved when copying maps through getTableMap

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tonygermano tonygermano force-pushed the preserve-http-parameter-order branch from ee8719d to 6ba242c Compare December 13, 2025 17:56
@mgaffigan
Copy link
Contributor

This seems to be merged in BL already: Innovar-Healthcare/BridgeLink@bca952d

Copy link
Member

@tonygermano tonygermano left a comment

Choose a reason for hiding this comment

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

This PR replaces the authorship from the original PR (the bridgelink commit does not acknowledge either of the two original authors.)

cmcquillen and others added 2 commits December 13, 2025 22:25
The HttpUtil.getTableMap method creates and returns a copy of a Map.
This commit changes the new Map instance from a HashMap to a
LinkedHashMap in order to preserve the iteration order of the original
Map being copied.

Issue: nextgenhealthcare/connect#6276
Original-pull-request: nextgenhealthcare/connect#6296
Signed-off-by: Tony Germano <tony@germano.name>
Signed-off-by: Richard Ogin <rogin@users.noreply.github.com>
@tonygermano tonygermano force-pushed the preserve-http-parameter-order branch from 6ba242c to 1cf1c6f Compare December 14, 2025 03:30
@tonygermano tonygermano merged commit 1cf1c6f into OpenIntegrationEngine:main Dec 14, 2025
2 checks passed
@tonygermano tonygermano added this to the Next Release milestone Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants