Skip to content

Commit

Permalink
Prevent erroneous "type" property completions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Jan 17, 2020
1 parent 925968d commit 0eea20c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/completers/openapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ class OpenAPIPlugin {

const partialKey = readingKey.join('')
const proposals = Object.keys(prop)
.filter(key => key.startsWith(partialKey))
// The `typeof prop[key] !== 'string'` eliminates the final `{ "type": "string" }`
// from showing up.
.filter(key => key.startsWith(partialKey) && typeof prop[key] !== 'string')

return callback(null,
proposals
Expand Down

0 comments on commit 0eea20c

Please sign in to comment.