fix: allow to omit api version with custom backend url #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Blockfrost RYO exposes all endpoints in the following format
host:port/*
. However, this SDK constructs the URL in a format<base_url>/<api_version>
withapi_version
falling backv0
if omitted or set toNone
while instantiating SDK client.Solution
This PR introduces breaking change (for people using custom
base_url
value) to fix this behaviour.If
base_url
is passed toBlockFrostApi
constructor then alsoapi_version
will be used (instead of falling back tov0
). Ifapi_version
is omitted or set toNone
then onlybase_url
is used.Related issues
#28 (which proposes workaround with passing empty string to
api_version
)todo:
base_url
with and withoutapi_version