joi icon indicating copy to clipboard operation
joi copied to clipboard

Multiple uri validation

Open seungho-hub opened this issue 11 months ago • 2 comments

What problem are you trying to solve?

i try to validate multiple uri in a string that separate by comma( , )

I found a very similar pr

so i expect uri({multiple : true}) but it does not exist.

There may be other solutions but I think this is a pretty consistent feature considering email({ multiple : true }).

Do you have a new or modified API suggestion to solve the problem?

joi.string().uri()

joi.string().uri({
    multiple: true,
})

seungho-hub avatar Feb 26 '24 10:02 seungho-hub

IMHO email made sense because there are standards that take multiple emails this way, can you mention a standard taking multiple uris?

Marsup avatar Feb 26 '24 18:02 Marsup

Thank you for your reply 😃

definitely the idea of seperating uri with comma is a terrible thing

instead of comma, RFC 3986 recommends some ways to delimiting uri in context in appendix-C.

seungho-hub avatar Feb 27 '24 02:02 seungho-hub