Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix: only try to expose supported methods (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flydiverny authored Apr 30, 2020
1 parent 889c417 commit 827db20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ class Component {
//
// "Expose" operations by omitting the leading _ from the method name.
//
Object.keys(endpoint.pathItem)
const supportedMethods = ['get', 'put', 'post', 'delete', 'patch']

supportedMethods
.filter(method => endpoint.pathItem[method])
.forEach(method => {
component[method] = component['_' + method]
if (method === 'get') component.getStream = component._getStream
Expand Down

0 comments on commit 827db20

Please sign in to comment.