I would like to make a web API that can return JSON data but I'm debating
whether to make it RESTful or whether to try something more along the lines of
an orchestration API.
Can resteasy make an API that responds with multiple data types in one response?
Does resteasy have the ability to do deep loads and deep saves?
Two Simple "Deep" Scenarios:
If I request a list of users and the groups they each belong to, I don't want
the same group sent multiple times with each member, but rather a foreign key
that I can use to match up with the groups that each user belongs to. However,
if I make one request for users, then another request for the groups that they
all belong to, then I've made two round trips when I should only have to make
one. Does resteasy have a mechanism for sending data of multiple (related) data
types in one response to avoid additional http requests?
Likewise, if I'm saving a new user and the group already exists, I can just
save a foreign key to the group. But if the user and the group are both being
created with the same http request, I would expect it to first persist the
group, obtain the new group's primary key, and then persist the user with a
foreign key to the group that was just persisted. Does resteasy address this
use case? I can handle the directed object graph so that dependencies get
persisted before things that depend upon them. But I'm just wondering if
resteasy provides a vehicle for this type of transaction.
I'm under the impression that strict REST defines different URLs for different
resources (users and groups), so I understand that resteasy may not address
those use cases _by design_. Or perhaps it has another means of reducing or
combining requests when obtaining data of different types.
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
Resteasy-users mailing list