3 ms·
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 documente
by tsimionescu 6y ago
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.
- cerberusss 6y ago> 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?
- tsimionescu 6y agoJSON, 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.