News for hackers. Stuff that matters.

Ask HN: JSON-schema or protobuf?

We have been using JSON for our REST APIs and JSON-schema (json-schema.org) to define the data format. We have java and .net generators to create POJO and POCO classes from JSON-schema. Recently, I got to know about Protocol Buffers from Google and was wondering what are the benefits of it over JSON. A simple Google search did not give any satisfactory answer. Hoping to get some insight from people who have used both, better if moved from one to another.
( 2 comments | on HN )
Re:Ask HN: JSON-schema or protobuf? by PaulHoule on Monday June 20, 2016 @11:49AM (#11938783)
The main benefit of protobufs is performance. It definitely is CPU intensive to write and consume JSON documents.

From a software engineering perspective they seem pretty similar to me, particularly in that NEITHER has support for a fixed decimal format which is essential for doing money calculations and getting the right answers.

Re:Ask HN: JSON-schema or protobuf? by msoad on Monday June 20, 2016 @12:14PM (#11938979)
Swagger uses json schema. If you want to get free documentation it makes sense to use json schema and quickly put together a swagger description of your api to get free docs for your api. You will also get a lot of good tooling around your api