ramlo icon indicating copy to clipboard operation
ramlo copied to clipboard

Parsing RAML 1.0 response examples

Open Plackier opened this issue 8 years ago • 0 comments

For RAML 1.0 APIs, in ramlo\src\modules\api.js:328

apiExample = {
    response: body.toJSON().example,
    code: response.code().value()
};

the apiExample.response returns an object, so the following code

apiExample.response = apiExample.response && hljs.highlight('json', apiExample.response).value;

throws a [TypeError: value.substr is not a function].

For RAML 0.8 APIs, it works fine - the apiExample.response is a string. It might be something with the parser tools.

Plackier avatar Aug 09 '16 16:08 Plackier