Inconsistent API results #1003

Open
opened 2026-10-05 00:28:02 +02:00 by adam · 2 comments
Owner

Calling pwg.categories.getList with tree_output set to true returns just a list of categories, whereas with false you get a hash with the single key "categories" and the category list as a value. That doesn't make a whole lot of sense.
Now if the API was versioned, this could be fixed in a new revision, but as it stands, it will probably need a new method call, or compatibility will have to be broken.

Calling `pwg.categories.getList` with `tree_output` set to true returns just a list of categories, whereas with false you get a hash with the single key "categories" and the category list as a value. That doesn't make a whole lot of sense. Now if the API was versioned, this could be fixed in a new revision, but as it stands, it will probably need a new method call, or compatibility will have to be broken. <!-- github-sync-id:561104736 -->
Author
Owner

Well... your script/app will either use tree_output or not. So, why do you care about consistency of the output with or without this parameter?

I confirm we can discuss about the output, but we can't change it without breaking third party apps, which is highly not a good option :-)

Well... your script/app will either use `tree_output` or not. So, why do you care about consistency of the output with or without this parameter? I confirm we can discuss about the output, but we can't change it without breaking third party apps, which is highly not a good option :-) <!-- github-comment-id:583442496 -->
Author
Owner

I'm developing a new Perl module for simpler web service access, and this just struck me as something I wouldn't want to document -- but I have to cover both cases with one method. There's a pretty workaround though ... so perhaps just understand it as "if anyone touches this any time soon, think about adding a versioned API" ;-)

I'm developing a new Perl module for simpler web service access, and this just struck me as something I wouldn't want to document -- but I have to cover both cases with one method. There's a pretty workaround though ... so perhaps just understand it as "if anyone touches this any time soon, think about adding a versioned API" ;-) <!-- github-comment-id:583726884 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1003