-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Ensure query parameters are added to requests with a body #1634
Fix: Ensure query parameters are added to requests with a body #1634
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1634 +/- ##
============================================
- Coverage 54.45% 54.23% -0.23%
Complexity 1363 1363
============================================
Files 112 112
Lines 10010 10031 +21
Branches 973 971 -2
============================================
- Hits 5451 5440 -11
- Misses 3949 3979 +30
- Partials 610 612 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent fix, and great overall quality enhancements for the class design.
Kindly just comment the test and let's merge.
} | ||
"""; | ||
List<List<Object>> parameters = Arrays.asList(Arrays.asList("access_key", "your-access-key")); | ||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly comment this line to prevent the test from running in the pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted @test line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong my friend. Can you check the changed files tab? I can only see the test file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both exist now (Test file and changes on RequestBuilder class)
This pull request fixes a bug where query parameters were not being added to requests that also have a body. It improves the performRequest method to ensure query parameters are correctly appended to the URL, along with enhancing error handling and modularizing the code.
src/main/java/com/shaft/api/RequestBuilder.java
When making HTTP requests with both query parameters and a request body, the query parameters were ignored, resulting in incorrect request URLs.
Dynamic URL Construction: Added functionality to append query parameters to the request URL, ensuring they are not lost when a body is present.
Comprehensive Error Management: Improved exception handling to manage errors during the request process effectively.
Modular Helper Methods: Created helper methods to append query parameters, check supported request types, and handle exceptions.
Linked Issue:
Fixes #1615