fix: Set call handling to not use base url as path#292
Conversation
Summary of ChangesHello @itachi1706, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a bug in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an API call URL construction bug where the base URL was being used as both the base and path, resulting in incorrect $baseUrl/$baseUrl calls. The fix introduces a separate optional path parameter that defaults to an empty string, enabling proper $baseUrl/$path URL construction.
Key changes:
- Added a new
pathproperty to the Builder class to separate path from base URL - Added a
setPath()method to allow setting the path - Modified the call handling to use the path instead of base URL for the endpoint
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
helperlib/src/main/java/com/itachi1706/helperlib/helpers/ApiCallsHelper.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue where the base URL was being used as the path in API calls made through the Builder pattern, which caused incorrect URLs like $baseUrl/$baseUrl. The introduction of a path variable in the Builder and using it in the internalCallHandling call effectively resolves this. My only suggestion is to add KDoc to the new setPath method for consistency and better documentation.
helperlib/src/main/java/com/itachi1706/helperlib/helpers/ApiCallsHelper.kt
Show resolved
Hide resolved
|



The current implementation makes it such that the base url is also the path. As a result when using the builder pattern it will attempt to call
$baseUrl/$baseUrlwhich is incorrectThis change converts the call to a new path variable so that it calls
$baseUrl/$pathcorrectly. And this path is optional and defaults to an empty string so that you can choose not to use it.