hapijs / joi

The most powerful data validation library for JS
Other
20.75k stars 1.51k forks source link

Multiple uri validation #3020

Open seungho-hub opened 4 months ago

seungho-hub commented 4 months ago

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,
})
Marsup commented 4 months ago

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

seungho-hub commented 4 months ago

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.