Ask HN: Recommend an IDL for HTTP/JSON APIs
I use Node.js for server side code, but the lack of types for requests and responses means I re-write the same general code:
- Validating incoming/outgoing JSON
- Writing the web JS based client (mapping HTTP to specific JS functions and objects).
Id like to use something that acts as a proxy between my client and server that defines the set of requests and responses that are valid, which would enable auto generating the client and server stubs, leaving me to write the function bodies on the client and server.
Protocol Buffers and Flat Buffers seem to be for binary and systems programs, browser based clients seem bolted on. I care less about encode/decode efficiency, and more about runtime validation of inputs and outputs, and the ability to replace the client/server by having a machine checkable spec for what my service is.
The Open API also seems complicated, I want something more lightweight that keeps my time cost per iteration cycle low during development, and has minimal dependencies and maximum long term viability.
Any recommendations?
0 comments
[ 2.9 ms ] story [ 10.1 ms ] threadNo comments yet.