I've been thinking about the APIs for test reports if we support multiple
languages, and I think that we have to make the language part of the API route
so that users query for the language they want. The way things are now, I have
to make the current `/v3` APIs return only Perl 5 distributions and reports,
because there's no way of indicating you want anything else. We can't let them
do `GET /v3/report/dist/IO-Socket-IP` and get both Perl 5 and Perl 6 reports
back.
So, if we need to have the language as part of the API route, like
`/report/{{lang}}/dist/IO-Socket-IP`, I think it would be a good idea to
normalize language names to lowercase and remove spaces. So, "Perl 5" becomes
"perl5" and "Perl 6" becomes "perl6". That way the URLs are
`/v4/report/perl5/dist/IO-Socket-IP` and not
`/v4/report/Perl%205/dist/IO-Socket-IP`.
The problems this introduces is that now we likely need a mapping of
"normalized language name" to "display name" (`perl5` -> "Perl 5"). I'd've
liked to stay away from that, but I think the benefit of saner URLs overrules
this. Also, if we use the language's logo, we would need a mapping anyway.
Does this sound good to you? Is there some other way we can address the problem
of querying reports for specific languages? If we're going to make changes
here, we should make them before people start submitting reports (so, before
you release new clients or I release the Metabase compatibility API I'm almost
done with).
Doug Bell
[email protected]