-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3] Better data structure returned by Pages API batch mode: hash not array #232
Comments
@JRice likes this :) |
NB, although not backwards compatible, the batch mode is very new, and afaik I'm the only one really using it, so this cane could probably be pushed without bumping the API number (although we should probably notify @iimog and Jorrit) |
Any ETA on this one |
good question. We've taken a break from data services to put out fires, resurrect harvesting, and make progress on v3. We should be able to pick up one or two. Is this your top item in data services, @hyanwong ? @jhpoelen what's your favorite at the moment? |
@jhammock @hyanwong If I would have to choose, I'd pick #162 - taxon hierarchies dump including related page id, external taxon ids (e.g. itis ids), ranks, common names and a thumbnail image. An example can be found here: https://github.com/jhpoelen/fishbase_taxon_cache . |
I believe the work on this is complete. @JRice is it awaiting deploy? |
If someone could post here when it is live on the main site, that would be great, as I'll need to switch my JSON code to conform to the new format. |
As discussed in gitter. At the moment a pages API batch mode call (#40) returns an array of hashes (dictionaries), with each containing a single item [{ID1:{data}}, {ID2:{data}}]. I suggest we should simply return a single dictionary, keyed by page id, i.e. {ID1:{data}, ID2:{data}}. This also prevents the JSON array return vulnerability too (http://stackoverflow.com/questions/3503102/what-are-top-level-json-arrays-and-why-are-they-a-security-risk)
In addition, we should ensure that the ID keys are identical to the IDs passed in to the API. At the moment, where multiple IDs map to the same page, the API returns the lowest value. So if you pass in e.g. id=2201694,... the return value is [{1049441:{"identifier": 1049441,...}},{...}]. I suggest for this example we should return {2201694:{"identifier": 1049441,...}} which will tell users that the id maps to a new value.
The text was updated successfully, but these errors were encountered: