code-gov-api icon indicating copy to clipboard operation
code-gov-api copied to clipboard

Add /licenses endpoint

Open DanielJDufour opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] We want to be able to dynamically display filter options for licenses in the browse projects page without having to make a request for data from all of the repositories. It would be great if we could hit a licenses endpoint, which returns the valid, normalized, and standardized licenses that exist within our index.

Describe the solution you'd like A clear and concise description of what you want to happen. I'd like to fetch /licenses and have it return an array of objects like

[
    { "name": "Creative Commons Zero v1.0 Universal", "id": "CC0-1.0" },
    { "name": "Apache License 2.0", "id": "Apache-2.0" }
]

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. I can write a script that runs this process and saves it to a file as a part of the webpack build process. This would mean however the licenses filter box would not auto-update.

Additional context Add any other context or screenshots about the feature request here. This is a medium priority because I can work around this with a static manually-generated licenses file. The set of licenses used on code.gov doesn't change at a high frequency.

DanielJDufour avatar Sep 25 '18 19:09 DanielJDufour