-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom validators for methods #87
Conversation
Looks good, in general. Just a couple of notes:
|
04df378
to
b1f75d4
Compare
* @param {String} [declaration.name] Parameter name. | ||
* @param {String} [declaration.description] Parameter description. | ||
* @param {String} [declaration.type] Parameter type. | ||
* @param {Boolean} [declaration.required] Should the parameter be made obligatory. | ||
* @returns {*} | ||
* @throws HTTP error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why HTTP error? )
b1f75d4
to
cc2fb1c
Compare
param1: {type: 'String'} | ||
}, | ||
options: { | ||
paramsValidation: function (paramValue, paramType, paramName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature has changed
c17f797
to
d38d14a
Compare
d38d14a
to
98b93d2
Compare
Any suggestions? Merge? |
Almost LGTM. The pipe is still unescaped :)) |
GH shows a bad diff. It'is escaped. |
There are two of them. |
🤘 |
98b93d2
to
edd9dfd
Compare
OMG :) |
Custom validators for methods
I want to keep current normalize system, @twoRoger wants a stricter system (#79).
Let's think about validator mechanism in the library.
Default validation mode is
normalize
(current way to preprocess parameters). We can add an extra one —strict
, for instance. Also a developer has a chance to declare just a custom function for this issue.This option should be declared to each API method.
Opinions? Cons/pros?