-
Notifications
You must be signed in to change notification settings - Fork 42
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
For templates.find, return JSON parsed body #111
Comments
This seems to go for all calls, not just |
It seems to be a misuse of the |
You are correct and I have this fixed I the 2.0.0 wip because we determined it would be a breaking change for the 1.x line. We also determined it only happens for get requests. |
When will 2.0.0 be out? I've fixed it myself (along with adding a line missing from my PR for subaccounts; forgot to |
We don't have a date yet. We are trying to make sure we cover any and all breaking changes. If you want to do a PR for what you left out of subaccounts, I can do a patch release. |
Already did. |
I'm not sure that the current code in the wip-2.0.0 branch is the best approach for this. Instead of the simple // set JSON (Always true)
options.json = true; I'd suggest checking that My own fix attempt uses this code instead to deal with // shift request body to options.body if set on options.json
// otherwise default to accepting json responses
if (options.json && typeof options.json !== 'boolean') {
options.body = options.json;
options.json = true;
} else if (typeof options.json === 'undefined') {
options.json = true;
} You might or might not find this a better approach, but it might help in moving things along towards final 2.0.0. |
Closed by #163 |
Sorry I didn't get a chance earlier but yeah that looks just fine. |
User should not have to
JSON.parse(res.body)
. It should be returned as JSON.The text was updated successfully, but these errors were encountered: