Looking to improve a bit the readability on the javascript snippets to something like this. Thoughts?
var coreapi = window.coreapi;
// Initialize a client & load the schema document
var client = new coreapi.Client();
var url = 'http://petstore.swagger.io/v2/swagger.json';
client.get(url)
.then(function(document) {
// Interact with the API endpoint
var action = ['pet', 'addPet'];
var params = {
category: ...,
status: ...,
name: ...,
tags: ...,
photoUrls: ...,
id: ...
};
return client.action(document, action, params=params);
})
.then(function(result) {
// Return value is in 'result'
console.log(result);
});
Looking to improve a bit the readability on the javascript snippets to something like this. Thoughts?