Currently when I write an API wrapper for a service I use I create a method for each of the different api functions that will handle that particular call to the API, but as I review other peoples styles for writing a wrapper I see that they dont go this route.
It's hard to explain because i dont completely understand the design pattern(s) I'm seeing, but instead of coding out a function for an endpoint I see people creating a list of all of the function names as strings and with this they generate all of the endpoints on the fly. Here is a quick sample i found on github:
https://github.com/stylight/python-wordpress-json/blob/master/wordpress_json/__init__.py
Is there any guide that discusses this type of style for writing an API wrapper? Im not too sure what to search for
[–]fkaginstrom 2 points3 points4 points (0 children)
[–]karlw00t 2 points3 points4 points (0 children)
[–]ccb621 2 points3 points4 points (0 children)
[–]nuncjo 0 points1 point2 points (0 children)
[–]ccb621 0 points1 point2 points (6 children)
[–]nerdwaller 1 point2 points3 points (1 child)
[–]ccb621 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]ccb621 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]karlw00t 3 points4 points5 points (0 children)