@@ -126,7 +126,7 @@ internals.input = async function (source, request) {
126126 const schema = request . route . settings . validate [ source ] ;
127127 const bind = request . route . settings . bind ;
128128
129- var value = await ( typeof schema !== 'function' ? internals . validate ( request [ source ] , schema , localOptions ) : schema . call ( bind , request [ source ] , localOptions ) ) ;
129+ var value = await ( typeof schema !== 'function' ? schema . validateAsync ( request [ source ] , localOptions ) : schema . call ( bind , request [ source ] , localOptions ) ) ;
130130 return ;
131131 }
132132 catch ( err ) {
@@ -217,7 +217,7 @@ exports.response = async function (request) {
217217 let value ;
218218
219219 if ( typeof schema !== 'function' ) {
220- value = await internals . validate ( source , schema , localOptions ) ;
220+ value = await schema . validateAsync ( source , localOptions ) ;
221221 }
222222 else {
223223 value = await schema ( source , localOptions ) ;
@@ -238,13 +238,3 @@ exports.response = async function (request) {
238238 return request . _core . toolkit . failAction ( request , request . route . settings . response . failAction , err , { tags : [ 'validation' , 'response' , 'error' ] } ) ;
239239 }
240240} ;
241-
242-
243- internals . validate = function ( value , schema , options ) {
244-
245- if ( typeof schema . validateAsync === 'function' ) {
246- return schema . validateAsync ( value , options ) ;
247- }
248-
249- return schema . validate ( value , options ) ;
250- } ;
0 commit comments