Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some APIs are returning nested arrays #3705

Open
misaugstad opened this issue Oct 23, 2024 · 0 comments
Open

Some APIs are returning nested arrays #3705

misaugstad opened this issue Oct 23, 2024 · 0 comments

Comments

@misaugstad
Copy link
Member

Brief description of problem/feature

Some of our less-used internal APIs are returning nested arrays instead of normal ones. You can see an example below:
Screenshot from 2024-10-23 14-02-24

We're returning a one-element array, and that element is the array that we actually wanted to return! Seems like we probably weren't using the Json.arr() function correctly in Scala, and then an early mistake was copied repeatedly as we added more API endpoints! I know for sure that we're doing this for /userapi/labelCounts/all and /userapi/validationCounts/all, but I suspect that we're doing it for many others, since we seem to be using Json.arr() in the same way in a lot of places. Most of these are likely just private APIs that are used primarily on our admin page.

Potential solution(s)

I'd like to have someone go through and find all the instances of this, probably just by searching for places where we use Json.arr(), check if the output of each of those APIs have this same issue, and fix it for any such APIs. Make sure to look at where we use those APIs as well, and make the appropriate adjustments on the front-end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant