You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a service that instantiates the PinchApiOptions in its constructor and is set as a readonly object. My class contains multiple methods, each of which pass the options into the PinchApi constructor. Given the PinchApi constructor is altering the BaseUri this is what happens.
Initially
When first created, the BaseUri is null as I hadn't configured it.
After an additional instantiation of PinchApi
The BaseUri is modified to "https://api.getpinch.com.au/test/test/"
which results in a 404 not found when attempting to calling my method.
I suggest moving the logic from the API constructor into the constructor of the PinchApiOptions which will set the default values. I would also set all the values to readonly { get; } meaning that after they've been set initially they can't be changed.
The text was updated successfully, but these errors were encountered:
pajohns
added a commit
to pajohns/Pinch.SDK
that referenced
this issue
Dec 8, 2023
Currently the Pinch.SDK.PinchApi constructor alters the base URI of the PinchApiOptions class that is being passed in through the following lines.
I have created a service that instantiates the PinchApiOptions in its constructor and is set as a readonly object. My class contains multiple methods, each of which pass the options into the PinchApi constructor. Given the PinchApi constructor is altering the BaseUri this is what happens.
Initially
When first created, the BaseUri is null as I hadn't configured it.
After one instantiation of PinchApi
The BaseUri is modified to "https://api.getpinch.com.au/test/"
After an additional instantiation of PinchApi
The BaseUri is modified to "https://api.getpinch.com.au/test/test/"
which results in a 404 not found when attempting to calling my method.
I suggest moving the logic from the API constructor into the constructor of the PinchApiOptions which will set the default values. I would also set all the values to readonly
{ get; }
meaning that after they've been set initially they can't be changed.The text was updated successfully, but these errors were encountered: