given posting endpoint so:
post http://foo.com/user/:user_id/articles
{ "content": "some text" }
when configure validator within config struggling find how inject :user_id route along "content" body. validator stuck trying validate if "content" ok without :user_id.
what proper apigility way inject ids (or ideally objects) route parameters validator(s) along normal body $data payload?
many thanks
as far know, apigility has no way validate route parameters. validate them in de resource or controller. way can more complex validation, id exist?
if want object route parameter, van try serializing object , putting in parameter. advice against this. trust external party provide whole objects? if need user info jwt or similar techniques. jwt authorisation token contains data (it's json based).
now, body params can validated. in apigility ui, can go fields, , add fields want validate there (or should of them simplicity). can assign filters , validators here. custom ones have configured in zf2 application.
Comments
Post a Comment