I have a problem with gson deserialization.
Incoming json looks like this {"roles":{"name":"bla" "perm" : "bla"}}
or when there is more roles available it looks like this
{"roles":[{"name":"bla" "perm" : "bla"}{"name":"hihi" "perm" : "hihi"}]}
. So first time parameter roles is an object and second time it's an array of objects.
Problem occures when my java class has field Role[] roles; and in json parametr roles is just one object exception is thrown "Expected BEGIN_ARRAY but was BEGIN_OBJECT".
Thank you in regards