-
-
Notifications
You must be signed in to change notification settings - Fork 813
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
add Docuseal (requires text/plain support or hack) #847
Comments
Hello @meonkeys ! I assume you got the parse error using the // fetch: function (path, init, json = true) -> the json parameter will activate or not the json parsing
this.fetch('http://your-url', null, false); |
Oh nice, that helps, thank you. Looks like diff --git a/src/mixins/service.js b/src/mixins/service.js
index b4fd2ad..7051a8f 100644
--- a/src/mixins/service.js
+++ b/src/mixins/service.js
@@ -56,7 +56,7 @@ export default {
throw new Error(`Ping: target not available (${response.status} error)`);
}
- return json ? response.json() : response;
+ return json ? response.json() : response.text();
});
},
}, Without that I'm getting Want a PR for that? Separate PR, I assume? ... see #850 |
Without that I'm getting Version "[object Response]" on the smart card from an api that returns text/plain. See bastienwirtz#847 - add Docuseal (requires text/plain support or hack)
Fixes bastienwirtz#847 Requires bastienwirtz#850
Good catch @meonkeys ! The response body wihtout json parsing has never been used (the ping component use the third parameter to false, but it does not use the response). |
Without that I'm getting Version "[object Response]" on the smart card from an api that returns text/plain. See #847 - add Docuseal (requires text/plain support or hack)
Docuseal now exposes its version at
/version
, but the response is atext/plain
string like1.8.3a
, not JSON. Can Homer somehow use this as-is?I tried creating a custom service / smart card like the others I've made, but I get
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 4 of the JSON data
in the console.I tried manually adding double quotes around the response, making it
"1.8.3a"
...then Homer accepts the string, but it prints
Version "1.8.3a"
on the smart card (with double quotes).The text was updated successfully, but these errors were encountered: