codeforamerica / cfapi

The Code for America API. Tracks and motivates activity and participation across the civic technology movement.
http://codeforamerica.org/api
MIT License
113 stars 52 forks source link

Tolerate new keys in issues' `label` dicts #334

Closed tdooner closed 5 years ago

tdooner commented 5 years ago

At some point, Github added a node_id key in the label dict. This is totally fair, it should be a backwards compatible change. However, since we passed in the raw API response as kwargs to the Label model, this resulted in an error.

In order to better handle this, I've updated the method signature of the Label constructor to take an arbitrary kwargs hash and pick out the values that are necessary.

Also, I updated the test data to prevent regressions.

Fixes #333.