Failed to fetch swagger with error message: Unexpected end of JSON input - json

I have a Function app, which i am calling from a logic App. When ever i am adding the Action for function app, My funciton app unable to retrive. Its showing the below error
Failed to fetch swagger with error message: Unexpected end of JSON
input. Ensure you have CORS enabled on the endpoint and are calling a
valid HTTPS endpoint
I have refereed --> Stackoverflow , but its not working.
Any help is really appreciated.
.

Related

Circular error-handler detected at route: {} - breaking out processing Exchange: {}

I am having multiple camel routes written in Java DSL exceptions are handled using OnException.
Below are my requirements.
Fetch token from cache and make http call
If http call fails with invalid token then make a back end call to get new token and then make http call
If http call fails with specific error then needs to handle it properly.
Issue:
If http call fails with invalid token then it is making backend call to fetch the token and then calling http request using exception handling code. Now the http call failed again while calling from OnException with some other error and it is not going to OnException and giving circular error handler message.
Please help me to handle this error. Thankyou
I am using SpringBoot camel starter 3.8.0 and Java 11

Getting only one line i.e Configure Successfully message in postman in json but when added in json file for asserting its taking as invalid [duplicate]

We are testing API Automation with Rest Assured in Java.
In Postman, we run API after success gives message as "Record Saved Successfully"
Trying to automate the same. How to validate only message recieve as response in body.
response.then().assertThat().statusCode(200);
.and().body("$", "Record Saved Successfully");
its not working, Please help
Use built-in assertion mechanism:
response
.then()
.assertThat()
.statusCode(200)
.body("message", equalTo("Record Saved Successfully"));

VM892:1 Uncaught SyntaxError: Unexpected token e in JSON at position 0

I'm presently working on a phx / phoenix API written in Elixir. And I have created a frontend for the API using React.js. However, I'm getting the below error message in the JS console of the browser.
I have successfully created a user using Postman, so I'm 99% sure the error isn't with the phx project, but rather somewhere with the React project.
I have both the frontend and backend hosted on github. And a .env file will need to be created in the root of the React project with the below line,
REACT_APP_API_URL=http://localhost:4000/api
and was working my way through the following tutorial.
Any and all help would greatly be appreciated.
The output of localStorage.getItem("token") being
eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJVc2VyOjEiLC‌​JleHAiOjE0ODcyODI4OD‌​csImlhdCI6MTQ4NDY5MD‌​g4NywiaXNzIjoiUGhvZW‌​5peENoYXQiLCJqdGkiOi‌​IwNzFlYzgwYi0wZmYzLT‌​QyYzgtODA3Mi1kNzViZm‌​VhZTg4NWEiLCJwZW0iOn‌​t9LCJzdWIiOiJVc2VyOj‌​EiLCJ0eXAiOiJhY2Nlc3‌​MifQ.NsuqH50HooK8vjF‌​fHtPH9iXSykZ9oYA0ul4‌​b_C5fQtpu_zFvNNy-skc‌​v9HI2i25X-NlB-9xOr-x‌​zh2abnrpYUw
suggests that for some reason, the app stored the token without passing it through JSON.stringify, and calling JSON.parse on this string throws the Unexpected token e error, as expected.
I did not see any localStorage.setItem without JSON.stringify in the current code, so the token was probably stored like that in a previous version of the app. You should try clearing it manually and logging in again.
When we get the non-JSON response, we get such error..
To avoid such error, mention the responseType: Text in your api endpoint call.
This will work,
return this.http.post(`${environment.apiUrl}/login`, user, {responseType: 'text'});
This will not work(If you mention type),
return this.http.post<string>(`${environment.apiUrl}/login`, user, {responseType: 'text'});
This error message usually means you're getting a non-JSON response. If you look at the raw response in the Network tab of your debugger, you should be able to see what you're getting back from the server.

We were unable to decode the JSON response from the Mandrill API

I am using the standard Code from: https://mandrillapp.com/api/docs/messages.php.html, require_once 'mandrill.php'; before using it and the directory is also right. But I am getting this exception the whole time, and I dont know why
Fatal error: Uncaught exception 'Mandrill_Error' with message 'We were
unable to decode the JSON response from the Mandrill API: window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function
r(t){if(!n[t]){var
o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var
o=e[t][1][n];return r(o||n)},o,o.exports)}return
n[t].exports}if("function"==typeof __nr_require)return
__nr_require;for(var o=0;op;p++)u[p].apply(s,t);return
s}function a(e,n){f[e]=c(e).concat(n)}function c(e){return
f[e]||[]}function u(){return t(n)}var
f={};return{on:a,emit:n,create:u,listeners:c,_events:f}}function
r(){return{}}var
o="nr#context",i=e("gos");n.exports=t()},{gos:"7eSDFh"}],ee:[function(e,n){n.exports=e("QJf3ax")},{}],3:[function(e,n)
in
Anyone an idea?
It is possible that you get this error when the mailservice is down or has Internal server errors (500). Embed your sending code in a try/catch block and use the catch block to fall back on another mailing service.

Exception java.lang.StringIndexOutOfBoundsException in REST JSON Grails

I used the plugin "JSON RESTful API for GORM" for Grails and I have the next exception:
Error 500: Internal Server Error
java.lang.StringIndexOutOfBoundsException
Message
String index out of range: -1
Around line 64 of JSONDomainMarshaller.groovy
But this only happens when my class domain has a reference to another class domain, the other simple class domain runs perfect.
I hope you can help.