Skip to content
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

Wrong parameter replacement due to how the API returns it #1

Closed
sabino opened this issue Aug 5, 2021 · 2 comments
Closed

Wrong parameter replacement due to how the API returns it #1

sabino opened this issue Aug 5, 2021 · 2 comments

Comments

@sabino
Copy link

sabino commented Aug 5, 2021

Hello there!

I've been trying to use this library and I've identified that some of the functions that uses the util/get-url are not properly replacing the parameters.

For instance, I've tried using the happygapi.serviceusage.services/enable$ function and it gives me a parsing error, which means it didn't respond with a json:

Execution error (JsonParseException) at com.fasterxml.jackson.core.JsonParser/_constructError (JsonParser.java:1840).
Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (StringReader); line: 1, column: 2]

The main issue is that the replacement is being without accounting for the prefix +, which could be removed when doing the replace in the get-url function:

(happy.util/get-url
  "https://serviceusage.googleapis.com/"
  "v1/{+name}:enable"
  #{:name}
  {:name "projects/sabino-proj-4clj/services/bigquery.googleapis.com"})

Outputs:

"https://serviceusage.googleapis.com/v1/{+name}:enable"

I'll suggest something on a PR.

@timothypratley
Copy link
Owner

Thank you!

timothypratley added a commit that referenced this issue Sep 27, 2021
@timothypratley
Copy link
Owner

timothypratley commented Sep 27, 2021

Hi @sabino

Just letting you know I've pushed version 0.4.8 to clojars with a fix for this behavior.

Sorry that it took me so long to get back to you about this!

Sincerely,
Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants