You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an attempt to diagnose an issue I was seeing in my app (which turned out to be the fourth item below), I stumbled across what seem to be some errors in the documentation.
JSON::Validator::Joi POD->SYNOPSIS: the schema declaration for the email field does not include ->string causing it to default to object, so testing the sample code does not work as expected.
JSON::Validator POD->SYNOPSIS: In the "Using Joi" section, if the code under "joi() can also validate directly" is run as written, it results in the @errors array containing a JSON::Validator::Joi object rather than any JSON::Validator::Error objects. As there is no corroborating documentation for the joi() function, I'm unsure whether this is a bug in the code, or just incorrect documentation.
JSON::Validator POD->SYNPOSIS: in the "Using Joi" section under "Use joi() to build the schema", the code will partially function, but without adding ->compile, some errors (like those related to the required and strict attributes) won't be output
Expected behavior
No validation errors (unless the point of this section is to demonstrate such a validation error, in which case that should be specifically called out)
No errors
The @errors array should contain /age: -42 < minimum(0) (JSON::Validator::Error)
The expectation is that everything stated in the code would be validated, if ->validate were to be called (though as the documentation is written, it is not)
Global symbol "@cpan" requires explicit package name (did you forget to declare "my @cpan"?)
The @errors array contains only a JSON::Validator::Joi object
Provided that the code was extrapolated into a complete "thought," the required attribute would be ignored, resulting in validation errors not being produced when they should be.
The text was updated successfully, but these errors were encountered:
Steps to reproduce the behavior
In an attempt to diagnose an issue I was seeing in my app (which turned out to be the fourth item below), I stumbled across what seem to be some errors in the documentation.
->string
causing it to default toobject
, so testing the sample code does not work as expected.'[email protected]'
not"[email protected]"
@errors
array containing aJSON::Validator::Joi
object rather than anyJSON::Validator::Error
objects. As there is no corroborating documentation for thejoi()
function, I'm unsure whether this is a bug in the code, or just incorrect documentation.->compile
, some errors (like those related to therequired
andstrict
attributes) won't be outputExpected behavior
@errors
array should contain/age: -42 < minimum(0) (JSON::Validator::Error)
->validate
were to be called (though as the documentation is written, it is not)Actual behavior
/email: Expected object - got string. (JSON::Validator::Error)
Global symbol "@cpan" requires explicit package name (did you forget to declare "my @cpan"?)
@errors
array contains only aJSON::Validator::Joi
objectrequired
attribute would be ignored, resulting in validation errors not being produced when they should be.The text was updated successfully, but these errors were encountered: