Forum Discussion

BostonKevin's avatar
5 years ago

Swagger Editor Cannot Process Multiline Response

An API call that I am documenting produces a multiline non-JSON response.  I am able to document a generic response successfully, up to a point.  However, a few characters in the response are not being read by Swagger editor properly.  I tried escaping various characters without success.  Perhaps someone has encountered a similar problem?


The code in question is as follows:


      type: string
      example: |
        var g_TranslationRules={};
        document.addEventListener("DOMContentLoaded",function(){MoxieTranslate("XXXX-XXXX-XXXX-XXXX", "https://localhost:6060/");});
        document.addEventListener("DOMContentLoaded",function(){MoxieStartStatsTimer("XXXX-XXXX-XXXX-XXXX", "https://localhost:6060/");});
        var sUrlForHash = document.location.pathname +;
        sUrlForHash = sUrlForHash.toLowerCase();
        var sUrlHash = FNV1aHash(sUrlForHash);
        var g_TranslationArray=null;
      	k$jax ({
		    url: "https://localhost:6060/" + "xapis/Pretranslate/" + "0149-BF69-EA83-32A3" + "/" + sUrlHash + ".json",
		    method: "GET",
		    success/: function (oXHR, oParms) {
			  var oJSON = null;
			  	oJSON = JSON.parse(oXHR.responseText);
			  catch (e) {}

The problem begins with k$jax . Any idea how I could get this string and what comes after to be displayed properly in the inspector panel?


No RepliesBe the first to reply