citizen icon indicating copy to clipboard operation
citizen copied to clipboard

Change list modules and search modules API calls to return unique modules rather than each module version.

Open xRokco opened this issue 2 years ago • 0 comments

Rather than returning a list of module versions this changes the API to return a list of unique modules.

It uses the MongoDB aggregate functionality to create a unique namespace + name grouping and returns the first module found for each unique grouping.

This better matches what I believe is the intended behaviour of the API calls based on the Terraform registry API docs and when compared with how the public Terraform registry acts.

This only changes the behaviour for MongoDB backed versions of Citizen.

A fix for https://github.com/outsideris/citizen/issues/94

xRokco avatar May 05 '22 11:05 xRokco