Skip to content
Permalink
Browse files

fix: parameter deprecation bug (#1323)

  • Loading branch information...
gr2m committed Apr 14, 2019
1 parent 65bd58b commit f1b9dea48077557cfc1189ba38b6476b689682b0
Showing with 5 additions and 1 deletion.
  1. +5 −1 plugins/validate/validate.js
@@ -21,10 +21,14 @@ function validate (octokit, options) {
return
}

if (parameter.alias in options) {
if (parameter.alias in options && parameterName in options) {
throw new HttpError(`Deprecated '${parameterName}' and '${parameter.alias}' cannot both be set`, 400, null, options)
}

if (parameter.alias in options) {
return
}

// There is currently no aliased parameter which is not deprecated at the same time
// if (parameter.deprecated) { }
octokit.log.warn(new Deprecation(`[@octokit/rest] "${parameterName}" parameter is deprecated for "${options.method} ${options.url}", use "${parameter.alias}" instead`))

0 comments on commit f1b9dea

Please sign in to comment.
You can’t perform that action at this time.