I've tested your code on my test website and it works as expected, even with the String Translation plugin activated.
Looks like something specific to your website is involved. The website is still not accessible, so I'll wait to hear back from you, once the website is back online.
I'll also need your permission to download a clone/snapshot of the website to test it on a different server, in case it's needed.
During testing on your website's clone, I was able to make this REST API endpoint work with the String Translation active, by changing the line in the 'get_author_posts' function from:
Hi Waqar, that seems to fix the query thanks. Can you tell me what is interfiring with that method though? That could be the cause of the other issue I talk about, when I want to filter by author posts in the WordPress dashboard the query shows an empty page.
Since I can't reproduce this behavior on a clean test website, it has to do with some user role and capability changes added to your website by a third-party theme or plugin.
The main difference between the 'author' and 'author__in' parameters is that the first one works for a single user ID and the second one checks from multiple (array) user IDs.
WordPress doesn't out-of-the-box support multiple user role assignments, but membership and user roles and capabilities management plugins can include it. That is the only logical explanation I can't think of.