diff --git a/OpenApi.vue b/OpenApi.vue index 984f5cc..9867fb5 100644 --- a/OpenApi.vue +++ b/OpenApi.vue @@ -92,7 +92,7 @@

Response

-        {{currentResponse}}
+{{currentResponse}}
       
@@ -185,8 +185,10 @@ export default { }, request() { this.currentResponse = '' - request.fetch(this.currentRequest, this.selectedEntry, this.api).then(body => { - this.currentResponse = JSON.stringify(body, null, 2) + request.fetch(this.currentRequest, this.selectedEntry, this.api).then(res => { + this.currentResponse = JSON.stringify(res.body, null, 2) + }, res => { + this.currentResponse = JSON.stringify(res.body, null, 2) }) } } diff --git a/request.js b/request.js index 02b288f..f7e905c 100644 --- a/request.js +++ b/request.js @@ -1,3 +1,5 @@ +import Vue from 'vue' + exports.reset = (request, entry) => { request.params = Object.assign({}, ...(entry.parameters || []).map(p => ({ [p.name]: p.schema.enum ? p.schema.enum[0] : (p.schema.type === 'array' ? [] : null) @@ -33,5 +35,5 @@ exports.fetch = (request, entry, api) => { httpRequest.headers['Content-type'] = request.contentType httpRequest.body = request.requestBody } - $http(httpRequest).then(response => response.body) + return Vue.http(httpRequest) } diff --git a/test/app.js b/test/app.js index 058cb47..6eb0b7c 100644 --- a/test/app.js +++ b/test/app.js @@ -13,7 +13,6 @@ Vue.material.registerTheme('default', { accent: 'red' }) -console.log(Vue.version) new Vue({ el: '#app', template: '',