- schema definition ( using something like typescript ? )
- data path ( similar to xpath )
- data transformation ( similar to xslt )
i'm pretty sure many people have done their things but i'm still waiting to see a tool like wsdl - based stub generators that would work on many json api.
ps : i know that things like jsonpath and wsdl2 exist, but i really feel like those technologies haven't caught widespread adoption.
Protocol Buffers and JSON have an extremely similar data model. The parts of them that people actually use are effectively identical. The actual differences are minor things like:
- JSON can have arrays of arrays; with Protocol Buffers you need a message in between.
- Protocol Buffers can represent binary data directly; with JSON you have to base64 encode it into a string.
- Protocol Buffers are more specific about the size of integer types (int64 and int32 are different); this allows for more efficient in-memory representations but doesn't matter so much on-the-wire.
I think the two are a match made in heaven.
There is a draft RFC called JSON Schema: core definitions and terminology (draft-zyp-json-schema-04).
> data path ( similar to xpath )
Dont use JSON if you should use XML.
The reason i'm using JSON is for the fact that's it's fast to parse, compact, and lightweight, compared to XML. Now the reason for needing the xpath/xslt/xsd version of json is not principaly because it's a serialization format, but because it's a serialization format used in almost any modern web API.
Experience shows that using JSON for web APIs is a good choice. Saying "you should've used XML" may have been relevant 5 years ago, but i think it's time to assume the fact that JSON is now so much used, that it needs the same kind of tools that xml has had almost from the start.
Something like SQLite work wells for purposes like these.