Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I had to restart my API over again I would make it self-documentable.

Browsing to /dogs with an Accept: text/html would include a description about that end-point with the possibly accepted parameters, and links to related resources.

If authenticated it would also include the content of that actual route and maybe even a small JavaScript request builder.



I like the idea of self documentation but please don't do this with a text/html header. Oftentimes I want to see in the browser what the GET response is. Probably it's better to explicitly use a .html extension instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: