Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

joi validation error message in path parameter value array to string

if(validationResult.error){
validationResult.error.details.forEach(function(error){
    if(error.path.length > 1){
        console.log(error.path.join("."));
    }else{
      console.log(error.path[0]);
    }    
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #joi #validation #error #message #path #parameter #array #string
ADD COMMENT
Topic
Name
7+5 =