What are you trying to achieve or the steps to reproduce ?
I use simple-auth2 and for there construtor require('simple-oauth2').create({...})
they use tokenHost: Joi.string().required().uri(['http', 'https'])
and our tokenHost as a value : 'https://ourdomain.com'
but if you run result with Object.keys(['http', 'https'])....
the Hoek.assert(unknownOptions.length === 0 will always be in error when they use it with a array...
Because the return is [0,1] so never 0 in length ...
Question ?
Is this the behavior wanted to return error when array ?
Or its a simple-auth2 error to use Array to validate ?
Ps.: 13.4.0 was working great, but since last update its broken for array...
Thx
ps.: Im not in simple-auth2 team, just a user of sa2
Yves Laroche
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
Context
What are you trying to achieve or the steps to reproduce ?
I use simple-auth2 and for there construtor require('simple-oauth2').create({...}) they use tokenHost: Joi.string().required().uri(['http', 'https']) and our tokenHost as a value : 'https://ourdomain.com'
Which result you had (Error)?
What did you expect ?
I see ligne 285 and 286 in Types/string/index was modify with
const unknownOptions = Object.keys(uriOptions).filter((key) => !['scheme', 'allowRelative', 'relativeOnly', 'allowQuerySquareBrackets'].includes(key)); Hoek.assert(unknownOptions.length === 0,
options contain unknown keys: ${unknownOptions}
);but if you run result with Object.keys(['http', 'https']).... the Hoek.assert(unknownOptions.length === 0 will always be in error when they use it with a array... Because the return is [0,1] so never 0 in length ...
Question ?
Is this the behavior wanted to return error when array ? Or its a simple-auth2 error to use Array to validate ?
Ps.: 13.4.0 was working great, but since last update its broken for array...
Thx ps.: Im not in simple-auth2 team, just a user of sa2 Yves Laroche