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

I agree with you 100%. In fact, in the REST standard in our company, we have 3 things that help with these problems:

1. All of our responses are well documented, both in separate docs and in a self-documenting format (you can GET .../$docs on any URL to get the description of field)

2. We support an "?includes=" query param that can be used to get arbitrarily deep data with a single GET request

3. Each object contains links to its relations, and these can often be relational-style queries. For example, you can make a request to /users and that would return a list of User objects, with each having a link for a field named "groups", with a link like /groups?userid=0. However, if you want directly the users with all groups, you can request /users?include=groups, and the backend will automatically populate that field as well.



> you can GET .../$docs on any URL

Wow, that is some next level stuff right there. Very nicely done. What do you get back? JSON, plain text, HTML, man page?


JSON, describing the fields of the objects. Honestly it's not very widely used, but it was an easy implementation so we decided to leave it exposed.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: