We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2837ef commit ce8fa1bCopy full SHA for ce8fa1b
1 file changed
public/src/App.vue
@@ -27,6 +27,7 @@
27
28
<script>
29
import OpenApi from 'vue-openapi'
30
+import yaml from 'js-yaml'
31
32
// https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
33
function getParameterByName(name, url) {
@@ -80,7 +81,13 @@ export default {
80
81
if (newUrl !== window.location.href) {
82
window.location.href = newUrl
83
}
- this.$http.get(this.useProxy ? ('./proxy?url=' + this.url) : this.url).then(response => response.json()).then(api => {
84
+ this.$http.get(this.useProxy ? ('./proxy?url=' + this.url) : this.url).then(response => {
85
+ try {
86
+ return yaml.safeLoad(response.bodyText, 'utf8');
87
+ } catch (e) {
88
+ return response.json()
89
+ }
90
+ }).then(api => {
91
this.api = api
92
this.error = null
93
}, error => {
0 commit comments