-
Notifications
You must be signed in to change notification settings - Fork 33
Image ids are incorrect in API output #470
Comments
I've just been looking at this and it seems that when the person record is re-saved the image id gets correctly saved as a string. So there's something funny going on when the image is first added to the record. |
Looking at this the problem is as much that popit is storing an images array which is not in line with the popolo spec. Ideally we should be returning just an image property which points to either the external URL or the URL of the image we have stored. |
Fixed in mysociety/popit-api@b223d28 |
Still seeing this issue when uploading a new image to a newly created document. |
The issue here is that the image is added to the So tl;dr the root of this issue is the fact that we have two sets of schemas accessing the same database table (one in the UI, on in the API) but representing them in different ways. The fix therefore is to consolidate the schemas so there is One True Source of data modelling. |
e.g. on http://congresistas-gt.popit.mysociety.org/api/v0.1/persons/5367ae9d7ee559063fbc6b6e the object in the
images
array has the following id property:Where it should actually just be a string:
Additionally it would be useful if each object in the images array had a
url
property pointing to the image.The text was updated successfully, but these errors were encountered: