Hello everyone!
With a couple colleagues, we're trying to validate long JSON structures and to convert them using a solution that would be easy enough using Phalcon's Annotations.
Let's say we get some data like the following as an input:
{"legs": ["lower-left", "lower-right"], "arms": ["upper-left"], "name": "The one armed man" }
We would then have as an output some objects that would be instances of these classes : Person(name, legs[], arms[])
, Leg(position)
and Arm(position)
.
Is it possible to use/extend/implement the existing model manager/annotations adapters to validate that said structure is valid on a set of classes? If yes, how could we use our set of "expected" classes?
Thanks a lot!
~Sjeannin