It is true that the code generator does not do this, but a JavaScript API exists, you can see here an Overview of what is possible and here is a complete API Reference . Here's also a quick tutorial on how to create a code generator in Paw .
Here is a snippet of how to get JSON from the last HTTP response for this request:
var MyCodeGenerator = function() {
this.generate = function(context) {
var responseBody = context.getCurrentRequest().getLastExchange().responseBody;
var responseObject = JSON.parse(responseBody);
return JSON.stringify(responseObject);
};
}
MyCodeGenerator.identifier = "com.mycompany.MyCodeGenerator";
MyCodeGenerator.title = "My Code Generator";
source
share