Migrating a REST-API implementation from Akka to ZIO

Americo Vargas
Nerd For Tech
Published in
30 min readSep 12, 2023

--

1. Introduction. Statement of the problem and a summary of the characteristics of the starting Akka-Http solution.

In a series of posts started here, more than two years ago, we explained in detail diverse solutions to a software development problem consisting of:

The implementation of a REST service based on the GitHub REST API v3 that responds to a GET request at port 8080 and endpoint /org/{org_name}/contributors with a list of the contributors and the total number of their contributions to the repositories of the GitHub organization given by the org_name part of the URL, in the following JSON format: { “repo”: <repository_name>, “contributor”: <contributor_login>, “contributions”: <no_of_contributions> .

The requests to the service must accept two parameters, one to choose between a repository-based or an organization-based accumulation of the contributions, and another to establish a minimum number of contributions for a contributor to appear explicitly in the response. The parameter names are “group-level” and “min-contribs”, respectively; the first accepts the values “repo” or “organization” (default), the second any integer value (default 0).

For an API call requesting a grouping at the organization level, the “repo” attribute of the response JSON records must have the value “All {org_name} repos” (a pseudo-repository used to represent the entire organization). In a similar way, the pseudo-contributor “Other contributors” must be used to

--

--