# Swagger, WADL or similar for the REST API?

**URL:** <https://meta.discourse.org/t/swagger-wadl-or-similar-for-the-rest-api/41623>\
**Category:** Development\
**Created:** [Março 27, 2016, 5:15pm UTC](https://meta.discourse.org/t/swagger-wadl-or-similar-for-the-rest-api/41623 "2016-03-27T17:15:54Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [Março 29, 2016, 7:06pm UTC](https://meta.discourse.org/t/swagger-wadl-or-similar-for-the-rest-api/41623/9 "2016-03-29T19:06:11Z")

</div>

> [@erkist](#):
>
> 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.

You are absolutely right. Though I think it’s a common problem for large RESTful website. It will takes so long time to just write the first draft of API ☹ These endpoints are so many and return different attributes based on user identity.

> [@erkist](#):
>
> 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.

This is a fairly nice way because that’s how I understand these endpoints. Beside that, `Network` tab in browser tool will show how Ember.js client talks with Rails. You do some actions and you can watch how it goes.

> [@erkist](#):
>
> 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

Postman are also useful to try different endpoints by API. `routes.rb` is the central point of endpoints, you can find every endpoints there. The hardest part is that you can’t discover what parameters you have to send.

> [@erkist](#):
>
> I’m sort of confident I can write such a specification, but I have no idea if I should.

It will be so nice if we have this specification. But It takes **HUGE** amount of time. If you insist, focus on topic list, users, category, badges, posts, topics, topic actions endpoints.

---

_[View the full topic](https://meta.discourse.org/t/swagger-wadl-or-similar-for-the-rest-api/41623)._
