Saturday, 6 May 2017

Validate multi level body with express validator

I've this body data:

{
    "type" : "cfe",
    "products": [
        {
            "key" : 123
        }
    ]
}

To validate multi levels, for example, type must be "cfe" or "literal" and products must be an array I must create a custom validator or express support multi level validator?



via Rodolfo Oliveira

No comments:

Post a Comment