Notice: My personal stance on AI generated artwork. Retweet and share if you agree. Let us discuss, and not immediately scream bloody murder.

Now Viewing: Inconsistent JSON & XML fields from API
Keep it civil, do not flame or bait other users. If you notice anything illegal or inappropriate being discussed, contact an administrator or moderator.

brute11k - Group: Project Sponsor - Total Posts: 4
user_avatar
Inconsistent JSON & XML fields from API
Posted on: 04/05/18 11:25PM

Hello,

Recently I've been tinkering with the API and I've found that XML fields look like that:

change
created_at
creator_id
file_url
has_children
has_comments
has_notes
height
id
md5
parent_id
preview_height
preview_url
preview_width
rating
sample_height
sample_url
sample_width
score
source
status
tags
width

While JSON fields follow as:

change
directory
file_url
hash
height
id
image
owner
parent_id
rating
sample
sample_height
sample_width
score
source
tags
width

Here's nice diff comparing two: i.imgur.com/teFE9c3.png
Was it intended? I would really like to use JSON version but I need `created_at` column.
Could it be there is a way to select fields?

Thank you for this awesome service!



lozertuser - Group: The Fake Administrator - Total Posts: 2230
user_avatar
Posted on: 04/05/18 11:44PM

We need to normalize the field names, however, we are trying to keep it compatible with Danbooru at all costs. I've added created_at field into the JSON api. Hopefully it works for you now.



brute11k - Group: Project Sponsor - Total Posts: 4
user_avatar
Posted on: 04/05/18 11:44PM

OK, I'm really dumb and haven't noticed you have a bug tracker here :q
gelbooru.com/index.php?page=tracker&s=view&id=921

Should I create another ticket asking for `created_at` field? I don't think it would slow down the API a lot.



brute11k - Group: Project Sponsor - Total Posts: 4
user_avatar
Posted on: 04/05/18 11:46PM

lozertuser said:
We need to normalize the field names, however, we are trying to keep it compatible with Danbooru at all costs. I've added created_at field into the JSON api. Hopefully it works for you now.


Ohmygosh! Best support ever. I'm considering donating a few bucks on Patreon :D
Thank you so much.



add_replyAdd Reply


1