Skip to content

Commit

Permalink
fix: prevent empty selectedType of requestBody
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed Oct 23, 2018
1 parent eb70f73 commit 62d0574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OpenApi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async function getTags(api) {
})
}
if (entry.requestBody) {
if (entry.requestBody.content) {
if (entry.requestBody.content && Object.keys(entry.requestBody.content).length) {
Vue.set(entry.requestBody, 'selectedType', Object.keys(entry.requestBody.content)[0])
entry.requestBody.required = true
Object.values(entry.requestBody.content).forEach(contentType => processContent(contentType, api))
Expand Down

0 comments on commit 62d0574

Please sign in to comment.