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
It is not possible to create an example for an array schema, as the value passed into the example function is concatenated with existing examples.
node version: 4.0.0
joi version: 7.2.3
environment (node, browser): no
used with (hapi, standalone, ...): standalone
any other relevant information:
What are you trying to achieve or the steps to reproduce ?
Trying to provide examples for a joi.array, so that schema.describe().examples will provide an array of arrays.
Describe your issue here, include schemas and inputs you are validating if needed.
Context
It is not possible to create an example for an array schema, as the value passed into the example function is concatenated with existing examples.
What are you trying to achieve or the steps to reproduce ?
Trying to provide examples for a joi.array, so that schema.describe().examples will provide an array of arrays.
Describe your issue here, include schemas and inputs you are validating if needed.
Which result you had ?
examples.length is 1
What did you expect ?
examples.length is 2
Offending line of code:
https://github.com/hapijs/joi/blob/master/lib/any.js#L447
The text was updated successfully, but these errors were encountered: