1
votes

When trying to import the swagger definition into WSO2 APIM publisher - the wso2 apim publisher failing with the following error -

ERROR - RhinoEngine org.mozilla.javascript.WrappedException: Wrapped com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 11 (http#17)

ERROR - WebAppManager org.mozilla.javascript.WrappedException: Wrapped com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 11 (http#17)

org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 11 (http#17)

Any solution to this problem?

3
Sounds like it's a malformed Swagger specification. Can you add it to your question? - Ron

3 Answers

0
votes

Did you verify the swagger definition for syntax errors .seems there is a json syntax error. use json validator like jsLint

0
votes

I assumed your APIM version is 1.8.

Can you please tryout below solution to fix the issue.

Move 'XMLHttpRequest' instance creation inside for loop in file, \repository\deployment\server\jaggeryapps\publisher\site\blocks\item-design\ajax\import.jag

Ex:
for(var i = 0; i < swaggerJson.apis.length; i++){
        var xhr = new XMLHttpRequest();
        xhr.open("GET", url + swaggerJson.apis[i].path);
        ...
0
votes

It has been resolved in the new WSO2 APIM 3.0 version. Try this out : https://wso2.com/api-management/