3 ms·
Protocol Buffers...GraphQL...JSON-API...so many damn choices for API implementation! Next we need someone's essay of a blog post comparing/contrasting them all.
by Dirlewanger 10y ago
Protocol Buffers...GraphQL...JSON-API...so many damn choices for API implementation! Next we need someone's essay of a blog post comparing/contrasting them all.
Also, the Protocol Buffers link in the 3rd paragraph is 404.
- euyyn 10y agoThanks for catching that! Fixing it (it should have pointed to "proto3", not "proto3.md").
- scarface74 10y agoIf you're using a good framework like C# Web Api, you don't have to choose. Just implement them all by adding them to the pipeline and the framework will automatically serialize/deserialize based on the accept header.
- mbesto 10y agoInteresting, do you have more details about this?
- scarface74 10y agoYou register your custom serializer at application startup... http://www.strathweb.com/2014/11/formatters-asp-net-mvc-6/ http://www.strathweb.com/2014/11/formatters-asp-net-mvc-6/ Your controller action looks like this: public List<Employee> Get() { ..... return employeeList; } Based on the serializers you have registered and the request Accept header, WebApi will serialize the list into JSON, XML, BSon (all built in) or a custom serializer that you add like Protocal Buffers http://www.infoworld.com/article/2982579/application-architecture/working-with-protocol-buffers-in-web-api.html http://www.infoworld.com/article/2982579/application-archite... Basically you can have all four registered and the client decides what it accepts.