[API] pwg.tags.getList & pwg.tags.getAdminList returning Ids of different types #1015

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

The methods pwg.tags.getList returns ids of photos as Integers while pwg.tags.getAdminList returns Ids as Strings.

This prevents from using the same type when using e.g. the Swift standard library. If these methods could use the same type (Integer or String), that would help developers of third party apps.

Here is the JSON returned by pwg.tags.getList:

              ▿ (2 elements)
                - key: result
                  - super: NSString
                ▿ value: 1 key/value pair
                  ▿ (2 elements)
                    - key: tags
                      - super: NSString
                    ▿ value: 3 elements
                      ▿ 6 key/value pairs
                        ▿ (2 elements)
                          - key: id
                            - super: NSString
                          - value: 1
                            - super: NSNumber
                            …

and here is the JSON returned by pwg.tags.getAdminList:

           ▿ 2 key/value pairs
              ▿ (2 elements)
                - key: result
                  - super: NSString
                ▿ value: 1 key/value pair
                  ▿ (2 elements)
                    - key: tags #5
                      - super: NSString
                    ▿ value: 4 elements
                      ▿ 4 key/value pairs
                        ▿ (2 elements)
                          - key: id
                            - super: NSString
                          - value: 1
                            - super: NSString
                            ...
The methods `pwg.tags.getList` returns ids of photos as Integers while `pwg.tags.getAdminList` returns Ids as Strings. This prevents from using the same type when using e.g. the Swift standard library. If these methods could use the same type (Integer or String), that would help developers of third party apps. Here is the JSON returned by `pwg.tags.getList`: ``` ▿ (2 elements) - key: result - super: NSString ▿ value: 1 key/value pair ▿ (2 elements) - key: tags - super: NSString ▿ value: 3 elements ▿ 6 key/value pairs ▿ (2 elements) - key: id - super: NSString - value: 1 - super: NSNumber … ``` and here is the JSON returned by `pwg.tags.getAdminList`: ``` ▿ 2 key/value pairs ▿ (2 elements) - key: result - super: NSString ▿ value: 1 key/value pair ▿ (2 elements) - key: tags #5 - super: NSString ▿ value: 4 elements ▿ 4 key/value pairs ▿ (2 elements) - key: id - super: NSString - value: 1 - super: NSString ... ``` <!-- github-sync-id:593352919 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1015