Phil Sturgeon, a PHP and API developer, writes about PHP, REST versus GraphQL, OpenAPI, JSON Schema and Markdown.
HN links it for PHP history, such as the T_PAAMAYIM_NEKUDOTAYIM error name, and for OpenAPI and JSON Schema incompatibilities.
Some searching turns up some articles on incompatibilities between OpenAPI and JSON Schema [0] [1], and it's not immediately clear if they fit together well at this point.
We've got some JSON Schema APIs in our services already and are using libs like the Python `json-schema` package to do validation with those. I also briefly experimented with Quicktype [2] to generate some TS types as a proof-of-concept.
We're getting ready to do a pretty big rework of a lot of our services, and I'm interested in any info folks can provide on pros and cons of using OpenAPI vs JSON Schema for API definitions, and tooling around request validation and TS interface / client generation.
[0] https://philsturgeon.uk/api/2018/04/13/openapi-and-json-schema-divergence-solved/
[1] https://github.com/OAI/OpenAPI-Specification/issues/1532
[2] https://quicktype.io/typescript/
I've heard this argument often, what behavior are people referring to when they talk about these advantages?
Is this just referring to using semantically correct HTTP status codes for things like caching, or is there more to it that I'm missing?
edit: And also, and perhaps most important, what about REST makes it easier to take advantage of the transport layer's advantages?
edit 2: This article has answered some of my questions and brought more clarity: https://philsturgeon.uk/api/2017/01/26/graphql-vs-rest-caching/
This is the same exact reason why PHP double colon errors still include the `T_PAAMAYIM_NEKUDOTAYIM` string somewhere in the error, as various error parsers still look for it even though the error messages have been updated to be clearer. The PHP team can't remove it or it will break tons of error parsers.
https://philsturgeon.uk/php/2013/09/09/t-paamayim-nekudotayim-v-sanity/
Yes it is comparable to Node. Most benchmarks show PHP with blocking calls against async Node calls. PHP has the tools to do async no problem. I use ReactPHP all the time to do this stuff; it works great for fast scraping.
See an older counter-point with the much slower PHP 5.5:
https://philsturgeon.uk/php/2013/11/12/benchmarking-codswallop-nodejs-v-php/
Not as cool as this, but here are some PHP "frameworks" in a tweet (140 characters):
http://www.twitto.org/
https://gist.github.com/mathiasverraes/9046427
https://philsturgeon.uk/php/2009/12/15/Twiny-Framework-the-framework-small-enough-to-tweet/
https://gist.github.com/jeremeamia/2720020
The thing about One Special Bigger Request is that it isn't cacheable. GraphQL is no exception: https://philsturgeon.uk/api/2017/01/26/graphql-vs-rest-caching/
If you want network-level caching, you want multiple atomic resource requests. HTTP2 enables this.