V
V
Vadim Ivanenko2015-03-10 15:03:17
API
Vadim Ivanenko, 2015-03-10 15:03:17

What do your APIs look like when you need to render a One-To-One relationship?

What do your APIs look like when you need to render a One-To-One relationship? (account 1 : 1 staff)
You can do something like this:
/api/account/1/staff/
but it looks like working with a staff collection (even the controller methods that the ZF2 router calls will be called getList(), deleteList() )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-03-10
@supra7sky

I usually have this: staff is a property of the account object, so either all information about staff is displayed at '/api/account/1', or only id is displayed there, and the staff object itself is obtained by the second request to '/api/staff/x '.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question