Swagger, WADL or similar for the REST API?

I’m not a particularly clever person, but from what I can see, that gem does not contain any information about what data is returned. Instead it relies on the API users somehow knowing what data is returned, which brings me back to my original problem of not having enough information to generate a strongly typed API.

Since my original post I’ve been playing around with Swagger a bit, and current-best-thinking is as follows:

  1. Use the source code of Discourse (not discourse_api) to get an idea about which data types are used in responses, and what data they share.
  2. Use discourse_api, the API documentation post and the Swagger specification created by @fantasticfears to get an idea about which requests exists, and what they do
  3. Write a complete Swagger specification including output data that can be used to generate a client in all languages supported by http://editor.swagger.io/ (and share it, of course!)

I’m sort of confident I can write such a specification, but I have no idea if I should.

So: Does anyone know any reasons doing this would be a bad idea?

1 Mi Piace