On Fri, Mar 18, 2011 at 10:47 AM, Martin Matula
<martin.matula_at_oracle.com> wrote:
> Noah said: "I suppose I could break this into two resources, one consuming
> JSON and one consuming FormData but I'd rather not - seems like it defeats
> the purpose."
> So, I was assuming he knows about breaking it up into two methods and was
> wondering how to avoid it.
Right right, agreed, he was trying to do it this way. I was just
pointing out that plain text String was not meant to be bound to
object; rather it would be (I thought) alternative representation. And
then the question of how to support alternatives is an interesting
one, given that they are structurally different (not just different
formats).
But maybe difference here is that just having 2 methods does not
create 2 separate resources (iff paths are the same), but just 2
physical end points.
Of course it is possible to get by with just a single method, taking a
String or byte[], and call binders manually based on incoming type.
Just couple more lines of code.
-+ Tatu +-