olhoneles / politicos-go

API com todos os candidatos Brasileiros!
https://politicos.olhoneles.org
GNU Affero General Public License v3.0
3 stars 1 forks source link

Create API response #2

Open marcelometal opened 4 years ago

marcelometal commented 4 years ago

The Politicos API v0 has the following response data:

{
    "meta":{
        "limit":20,
        "next":"/api/v0/political-parties/?limit=20&offset=20",
        "offset":0,
        "previous":null,
        "total_count":1
    },
    "objects":[
        {
            "founded_date":null,
            "id":1,
            "logo":null,
            "name":"Heavy Metal",
            "resource_uri":"/api/v0/political-parties/1/",
            "siglum":"HV",
            "tse_number":666,
            "website":null,
            "wikipedia":null
        }
    ]
}

Now we can think about the new response data or keep the current response.

luccamendonca commented 4 years ago

What if we follow the json-LD spec for the response metadata?

This way we don't need to try and reinvent the wheel, and there's even a go lib that could help us out.