jeudi 25 février 2021

Do you have to store resource if you publish it via rest api?

Let's say I have a rest api with a following endpoint: /foos/{fooId} which returns some object named of type foo. Now let's say I store different kind of resource in my database underneath, which is bars. Sample bar has some barId, and my resource available via api (foo) is a projection of a bar plus some other stuff. Does this design makes sense? If I don't store resource named foo and there is no such thing as fooId (just a projection of bar), is my api still restful?

Aucun commentaire:

Enregistrer un commentaire