Closed amandafrench closed 1 year ago
@amandafrench Try putting quotes (single or double) around the URL, so that the URL is interpreted as a string rather than BASH commands. The URL is getting truncated at the & character because it's a special character in BASH. Ex:
curl "https://api.ror.org/organizations?query=bath&filter=types:Facility,country.country_code:GB" | json_pp
Describe the bug When using cURL at the command line (Mac zsh) to submit API requests with query that include filters or paging, I get what look like numeric error codes, and if I try to pipe the results through JSON pretty print I get error messages about malformed JSON strings. The response is returned but not formatted.
To Reproduce Steps to reproduce the behavior:
curl https://api.ror.org/organizations?query=bath&filter=types:Facility,country.country_code:GB | json_pp
[1] 52410 malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/bin/json_pp5.30 line 52.
before expected results list.The same request without the attempt to pretty print will also return a numeric code such as
[1] 52427
before the result but will not produce an error message. Requests that use the query parameter but no filters do not produce error codes or messages, and requests that use filters alone without a keyword query also do not produce errors. Submitting the request in Firefox returns no errors, and the raw data can be pretty printed.Expected behavior Pretty-printed results list alone with no preceding errors.
Screenshots If applicable, add screenshots to help explain your problem
.
Device information:
Additional context Add any other context about the problem here.