guibranco / GuiStracini.SDKBuilder

:construction: :gear: A SDK framework that helps create a .NET SDK project for API wrappers/clients
https://guibranco.github.io/GuiStracini.SDKBuilder/
MIT License
1 stars 0 forks source link

[BUG] Incorrect Query String Formatting in URL #30

Open guibranco opened 1 year ago

guibranco commented 1 year ago

Describe the bug
The method is incorrectly adding /? for each parameter as a query string in the URL, leading to an improperly formatted URL when the query string already exists or when there are multiple additional parameters or empty parameters.

Link to the Code
You can find the problematic code here.

Steps to Reproduce
To reproduce the behavior, follow these steps:

  1. Create a BaseRequest inherited class with a query string in the route.
  2. Add two or more properties as AdditionalParameter to be included in the query string.
  3. Build the URL using these additional parameters, including some empty parameters.
  4. Observe the resulting URL.

Expected Behavior
The expected URL format should be:

someAddress?queryStringDefault=default&optional=1&optional2=2

However, the current URL being generated is:

someAddress?queryStringDefault=default/?optional=1/?optional2=2/?optional3=

Additional Context

Proposed Solution
Review the method responsible for building the URL to ensure it handles the query string correctly by checking if it already exists and appending parameters appropriately without the leading /?.

gitauto-ai[bot] commented 4 months ago

@guibranco Pull request completed! Check it out here https://github.com/guibranco/GuiStracini.SDKBuilder/pull/128 🚀

Note: I automatically create a pull request for an unassigned and open issue in order from oldest to newest once a day at 00:00 UTC, as long as you have remaining automation usage. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.