Skip to content

Preserve HTTP parameter order - #131

Merged
tonygermano merged 2 commits into
OpenIntegrationEngine:mainfrom
rogin:preserve-http-parameter-order
Dec 14, 2025
Merged

Preserve HTTP parameter order#131
tonygermano merged 2 commits into
OpenIntegrationEngine:mainfrom
rogin:preserve-http-parameter-order

Conversation

@rogin

@roginrogin commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

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
roginforce-pushed the preserve-http-parameter-order branch from a2e7a6b to abfeb65CompareJuly 4, 2025 01:49
@rogin
roginforce-pushed the preserve-http-parameter-order branch from abfeb65 to ee8719dCompareJuly 23, 2025 03:59
@pacmano1
pacmano1 self-requested a review August 30, 2025 17:18

CopilotAI left a comment

Copy link
Copy Markdown

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.

FileDescription
server/src/com/mirth/connect/util/HttpUtil.javaChanged HashMap to LinkedHashMap in getTableMap method to preserve insertion order of HTTP parameters
server/test/com/mirth/connect/util/HttpUtilTest.javaAdded 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
tonygermanoforce-pushed the preserve-http-parameter-order branch from ee8719d to 6ba242cCompareDecember 13, 2025 17:56
@mgaffigan

Copy link
Copy Markdown
Contributor

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

@tonygermanotonygermano left a comment

Copy link
Copy Markdown
Member

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.)

Comment threadserver/test/com/mirth/connect/util/HttpUtilTest.java
cmcquillenand 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
tonygermanoforce-pushed the preserve-http-parameter-order branch from 6ba242c to 1cf1c6fCompareDecember 14, 2025 03:30
@tonygermano
tonygermano merged commit 1cf1c6f into OpenIntegrationEngine:mainDec 14, 2025
2 checks passed
@tonygermanotonygermano added this to the Next Release milestone Dec 14, 2025
Sign up for freeto 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.

7 participants

@rogin@mgaffigan@kryskool@tonygermano@pacmano1@cmcquillen