Improve REST/API support
There's two existing modules, both of them fall short of designing a modern API: https://github.com/silverstripe/silverstripe-restfulserver
The number of API consumers is rising due to increased usage of frontend libraries like Backbone/Ember/Angular, and SilverStripe can be a powerful tool to drive those frontends if it had better API development support.
Specifically, add the following:
- More modularity (RESTfulServer is one monolithic class for all content types)
- Content negotiation
- Caching headers
- More powerful field mapping
- HAL to describe relationships and references
- Pluggable authentication (ship with OAuth by default?)
Alternatively, we might look into creating adapters for external libraries like https://apigility.org/.
We’re doing some GraphQL API work instead of REST support for SilverStripe 4: http://silverstripe.uservoice.com/forums/251266-new-features/suggestions/16924327-graphql-api-support
GraphQL is an alternative to REST, and well suited for modern frontend architectures. There’s still valid use cases for REST in SilverStripe, but from a core perspective we’re unlikely to build out core support for a REST layer in parallel to GraphQL, so moving this back from “planned” to “under review”.
AdminIngo Schommer (Admin, SilverStripe) commented
This has been replaced with https://silverstripe.uservoice.com/forums/251266-new-features/suggestions/16924327-graphql-api-support
Is there any update on this?
Jeremy Shipman commented
Now that I've been working with Ember.js for about 4 months, I'm really seeing the need for this kind of thing.
David Craig commented
No code has been written. But there is research under way, see the survey section http://www.silverstripe.org/community/contributing-to-silverstripe/
Tim Kinnane commented
Just jumping in to agree with all of the above and see if the last 6 months have brought any significant change?
Thierry François commented
Like Sam mentioned there is also my module https://github.com/colymba/silverstripe-restfulapi it doesn't come with everything but is easy enough to replace/extend the components with your own
Sam Minnée commented
Someone at the UK meet-up also vouched for this module:
Marcus Nyeholt commented
Adding support for "versions" of the API is something I've been considering for the webservices module.