Lets say you have this structure for a person for your REST API, this schema:
{
"id": 12,
"name":{
"first":"Angie",
"last": "Smith",
"middle": "joy",
"maiden": "crowly",
},
"address": {
"street": "1122 Something St.",
..and so on...
},
... and so on
}
and lets say you have a client of your API (lets say a very inexperienced set of web developers) come to you and say "Hey I need a list of all unique last names in the system".
Would you:
a) Tell that person "OK, sure, well names are already part of our people resource endpoint. We can return just a list of people that will give you just the name.last field back, and you'd only get one person for every different name.last that exists". Basically just give them an aggregated grouping of people in order to satisfy their need for basically every unique last name in the database for people.
so for hypothetical url example they'd just call /people?fields=name.last?aggregate
b) Say ok, I do everything you tell me to do because you apparently feel you still dictate the API after trying to talk to you the web team tactfully, and say Oh ok, we'll just create a special endpoint for you, we don't know what that resource or endpoint url would look like yet, but we'll give you just this:
{
"lastNames": {
"name": "Anderson",
"name": "Alvertson",
....etc.
}
}
And who knows what resource this even is, there is no name you can even give this.
And who knows how many "special endpoints" we'll need to create for this application therefore coupling our API to their implementation and disregarding the entire purpose of having and reusing resources that I have in place already.
You forgo all the benefits of REST because your client refused to understand that you have an Architecture and convention to maintain and you offer them what they need through resources you setup but they think it's odd that they have to adhere to any sort of resource template whatsoever and expect you to build infinitely/endless custom resources which there is no consistency or no way to even name these resources because they're coupling your API to their application and they expect you to adhere to whatever contract they feel you should design...meaning they feel they can literally tell you how to design your API and that you have no say!
And you know if you give in just this one time and bypass your current REST resource here which is "Person" that they'll most likely expect you to forgo any design decisions you've made or want to make with your API since you gave into them saying they don't care about your design yet you're the platform team creating this API for consumption company-wide!
or
c) just say f this and quit all together due to stress of dealing with these morons, and find a better place and team to work with, because after constructively and tactfully trying to tell them time and time again that we have conventions we're sticking with on the API, the web team still feels they need to dictate your REST API design 100% which they don't have a clue about REST and so they don't care what you say...they think they can just own the API even though it's you and the platform team building it out for the company for not only their consumption but possibly for other apps, services, or even exposing this API to public consumers in the future.
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
--