[API] pwg.images.upload returns nb_photos as a String or an Integer #1412

Open
opened 2026-10-05 00:42:50 +02:00 by adam · 0 comments
Owner

The methods pwg.images.upload returns the number of photos nb_photos in the category as an Integer or a String. From the tests I performed, it looks like the version 2.10.2 of the Piwigo server generally returns a string while the version 11.5 generally returns an Integer. As this seems not to be reproducible so I have recoded the iOS app to work with both types.

This prevents from using the same Decodable when using e.g. the Swift standard library. If this method could always return the same type (preferably Integer) in the future, that would help developers of third party apps.

The methods `pwg.images.upload` returns the number of photos `nb_photos` in the category as an Integer or a String. From the tests I performed, it looks like the version 2.10.2 of the Piwigo server generally returns a string while the version 11.5 generally returns an Integer. As this seems not to be reproducible so I have recoded the iOS app to work with both types. This prevents from using the same Decodable when using e.g. the Swift standard library. If this method could always return the same type (preferably Integer) in the future, that would help developers of third party apps. <!-- github-sync-id:1144727047 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1412