I have a web API that takes JSON. This JSON contains 3 parameters. As part of the internal processing this API will call another web API (B2B). only 1 parameters will be passed to the second API (madatory). My question is that should my API validate the parameter that will be passed to the second API or the second API should validate them ?
My WebAPI (parm1,parm2,parm3){
''''''
string result= anotherApi.dosomething(parm3)
'''''
}
In the above example should I validate parm3 (which is mandatory by the second API) so that I won't call the anotherApi or should I just let the anotherApi return an error to my api that I will return to the caller?