Skip to content

Commit

Permalink
fix: prevent undefined reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed Sep 23, 2020
1 parent c4425c1 commit d5514ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OpenApi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ export default {
})
this.currentRequest.security = newSecurity
if (entry.requestBody) {
if (entry.requestBody && entry.requestBody.selectedType) {
this.currentRequest.contentType = entry.requestBody.selectedType
const example = entry.requestBody.content[this.currentRequest.contentType].example
this.currentRequest.body = typeof example === 'string' ? example : stringify(example, null, 2)
} else {
this.currentRequest.body = ''
}
},
select(entry) {
Expand Down

0 comments on commit d5514ab

Please sign in to comment.