2 Properties with the same name on Album?
MaRi
Registered Users Posts: 21 Big grins
I've noticed that Album has two properties with the same name Comments
- one is a bool
- the other is a list of objects of type Comment
{
"stat": "ok",
"method": "smugmug.albums.getInfo",
"Album": {
"id": 1234,
...
"ColorCorrection": 0,
"Comments": true,
"Description": "Photos
"EXIF": true,
...
}
{ "stat": "ok", "method": "smugmug.albums.comments.get", "Album": { "id": 1234, "Key": "xCXXu", "Comments": [ { "id": 1234, "Date": "2007-09-11 00:46:21", "Rating": 5, "Text": "Great photos, looks like a fun party", "Type": "SmugMug", "User": { "Name": "Fred Nerk", "URL": "http://fred.smugmug.com" } } ] }}
Is this a feature? And is it going to remain like that?
- one is a bool
- the other is a list of objects of type Comment
{
"stat": "ok",
"method": "smugmug.albums.getInfo",
"Album": {
"id": 1234,
...
"ColorCorrection": 0,
"Comments": true,
"Description": "Photos
"EXIF": true,
...
}
{ "stat": "ok", "method": "smugmug.albums.comments.get", "Album": { "id": 1234, "Key": "xCXXu", "Comments": [ { "id": 1234, "Date": "2007-09-11 00:46:21", "Rating": 5, "Text": "Great photos, looks like a fun party", "Type": "SmugMug", "User": { "Name": "Fred Nerk", "URL": "http://fred.smugmug.com" } } ] }}
Is this a feature? And is it going to remain like that?
0
Comments
In a future version of the api, I'm considering changing the response format to...
{
"stat": "ok",
"method": "smugmug.albums.comments.get",
"Album": { "id": 1234, "Key": "xCXXu"},
"Comments": [ { "id": 1234, "Date": "2007-09-11 00:46:21", "Rating": 5, "Text": "Great photos, looks like a fun party", "Type": "SmugMug", "User": { "Name": "Fred Nerk", "URL": "http://fred.smugmug.com" } } ]
}
SmugMug API Developer
My Photos
In my case, they are two properties on the class Album. I have no other way of mapping the responses from smugmug.albums.getInfo and smugmug.albums.comments.get to the Album class except for using a property on Album called Comments and making it a bool for the first case and a Comment object in the second case. And this making it a bool or an instance of the Comment class depending on the circumstances, is a convoluted and prone to bugs way. So I would be very interested in the update you’re thinking of doing. That would most certainly solve the problem!
Thanks!