lundi 4 mai 2020

Update entities API segregation vs separate APIs

I have a class X which consists of an ID and 3 independent entities i.e. A,B,C. Each of these entity can have 1:N relation with the set of objects of X but obviously 1:1 with each object of X.

I want to build update operation for each set of these entities (e.g.{A}, {B}, {C}, {AB}, {AC}, {BC}, {ABC}).

We don't have any info on the no. of types of updates.

The total scale upper bound can be ~1000 requests per day.

Update operation will require the entity to be passed as a JSON string.

So, which is a better REST API design out of following two and why?

Design 1:

Update(A,B,C) where all but one can be null-able.

Design 2:

Update(A), Update(B), Update(C)

Aucun commentaire:

Enregistrer un commentaire