3 ms·
Swagger, OpenAPI, RAML, JSON Hyperschemas, toml/yaml/json ... I don't see how proliferation of ad-hoc syntax contributes to interoperability, which surely shou
by tannhaeuser 10y ago
Swagger, OpenAPI, RAML, JSON Hyperschemas, toml/yaml/json ...
I don't see how proliferation of ad-hoc syntax contributes to interoperability, which surely should be the goal of an API spec?
My take is that JSON has "won" over XML as RPC or REST serialization format because browsers support it OOTB and there's no schema needed. It simply is the way of least resistance. And since a browser front end is traditionally tied to a web backend anyway, there's no need for a formal "API" (protocol spec, actually) spec as an external artifact most of the time.
Once you try and impose typing on JSON, this very benefit turns against you, and is getting absurd IMHO. Every JSON typing regime needs to work around the fact that JavaScript isn't statically typed. Consider JSON Schema: it is reminiscent of a markup schema of sorts, when a more rational approach would IMO be to represent JSON payloads as an RPC/IDL function signature-style schema.