Hi, I’ve attached some comments below from one of our web developers. I was hoping to go through them and present some sanitised summary but I am running short of time so rather than sit on them I share below in their entirety.
They are a bit raw because they were really just sent to me but we will be thick skinned :-). All comments are valuable. Where they are incorrect just means we have not explained well enough yet. Where they are correct we should address
Regards
Bob
Hi Bob,
Some comments… I think parts of the spec is really bad, and not updated… so not sure if it all applies… seems like too many people are doing edits, and adding what they want… it should probably have a editor!
-
Do they want this to be a RESTful API? or are they just creating an API?
-
What is the facility.version field used for? will it also be used for collections of objects? (seems like it will be duplicated, since you are probably asking for a specific version?)
-
Facility.guid seems either like an unfortunate name for it, or just completely wrong altogheter. Will the guid actually link to something useful? will that page provide more information, or is it used more like XML namespaces? if you say the term GUID to developer (especially MS developers I guess), they will not think about URLs. I see that in some of the XML examples all the way down… url = guid…
-
FOSAID ?
-
Facility.properties, assume these are just key-value pairs? (attributes, basically)
-
What is the admin_unit field? I don’t see this in any JSON example? ?admin_user=Sud vs ?admin_user[]=Sud? Seems like a very strange syntax, but seems like it shouldn’t be in 0.9, so I guess its still being developed…
-
“Returns HTTP Response 200, 401 or 404 along with a human readable error message.” I guess 200 should be taken out of that:)
-
“Optional Verbose Error messages”, can more_info be both a URL, and a free-form text field? should it use the same key? Would be nice to also get the error-code, so that you don’t need to parse it out from the URL.
-
Versioning: most of the big guys uses headers for this now. From a REST purity standpoint, having it in the header makes the most sense, and if “jr developers can’t use them” (I saw this mentioned on the list), who cares (if they don’t know about http headers, how can they set a content-type?)
-
Adding: it should return 201 Created, and also the Location: as a header. Of course, if they don’t understand headers… we will have the same problem here as in pt 8
-
/facility/<facility_id>, what is facility ID? any identifier on the list? or just a guid? what if there are collisions?
-
Are they also using POST for updating? not PUT? seems bad… what about PATCH?
-
GET /facilities/.json/xml, would not work well with the way GUIDs are defined today… what about other identifiers?
-
Filtering options: I know they are using a backend that almost requires this, but do we really have to use the ugly $filter_option syntax? what are the advantage from just using gt/le etc?
-
/facilities/count.json, this really breaks REST (count is ID??), /facilities?countOnly=true or something would be much better
-
/facilities/count.json?beds=10, same here, you search for beds=10, but tell it with another query string saying that you only want the count. /facilities?countOnly=true&beds=10
-
?pages=all = returns all pages, is this meant to be a boolean? bad naming… what are the options here? can you do pages=1,2,3,4 ? probably not? I like our ?paging=false better…