API getRelatives. Why change return format when private?

+5 votes
143 views
getRelatives with getSpouses=1 (and similar) returns a nice nested json, eg

https://api.wikitree.com/api.php?action=getRelatives&fields=Name,Bio,IsRedirect,FirstName,LastNameAtBirth&keys=13767346&getParents=1&getChildren=1&getSiblings=1&getSpouses=1

When the connected profiles are private however, those profiles are not return, instead an empty [] (type: list) is returned. This change of type breaks simple validation. Could it be considered to return a simple empty {}?

Testcase: keys=31745274
in WikiTree Tech by Michel Vorenhout G2G6 Pilot (319k points)

1 Answer

+7 votes
I've wondered that myself before, but I've worked around it, checking for an array or an object, and it's possible that if this were changed now, some of my apps or WBE features may break.  I could fix them, but I'd rather not have to.
by Ian Beacall G2G6 Pilot (315k points)

This is an instance where Michel's proposal that the API use a versioning scheme might come into its own.

Yes, indeed, using versions is the way to manage these possibly breaking changes.

I have implemented an additional check, but would rather not do it.

Related questions

+8 votes
1 answer
271 views asked Apr 10, 2020 in WikiTree Tech by Brian Casey G2G Crew (370 points)
+2 votes
1 answer
145 views asked Jan 25 in WikiTree Tech by Tomáš Kratina G2G2 (2.3k points)
+6 votes
2 answers
174 views asked Jan 8 in WikiTree Tech by Michel Vorenhout G2G6 Pilot (319k points)
+7 votes
2 answers
+9 votes
3 answers
237 views asked Sep 28, 2022 in WikiTree Tech by Przemek Więch G2G5 (5.2k points)
+7 votes
3 answers
225 views asked Feb 1, 2022 in WikiTree Tech by Fairch Fairchild G2G3 (3.0k points)
+5 votes
1 answer
+8 votes
1 answer
359 views asked Jan 19, 2022 in WikiTree Tech by Ken McEvoy G2G6 Mach 1 (12.4k points)
+26 votes
2 answers
+5 votes
0 answers
108 views asked Aug 1, 2021 in WikiTree Tech by Kay Knight G2G6 Pilot (607k points)

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...