OasisDigital / angular-enterprise-example

Scalable / Large Angular application structure example
MIT License
125 stars 47 forks source link

Use json:api rather than ad hoc REST JSON #15

Open kylecordes opened 7 years ago

kylecordes commented 7 years ago

Currently the REST-JSON parts of this example use ad hoc REST implementations. They have a high degree of uniformity (because they have started out using json-server as a backend) but don't follow any particular specification.

Consider using json:api instead:

http://jsonapi.org/

There is both client and server side code available which conforms to the spec. It includes automatically, the various mechanisms needed for inter entity links, sorting and paging, and numerous other conveniences.

Possibly useful tool: https://github.com/abdulhaq-e/ngrx-json-api

(There are complex trade-offs in choosing a client/server API style and spec - although GraphQL is the big new thing and potentially an enormous payoff for some projects, REST still has many appropriate uses.)