Asana / python-asana

Official Python client library for the Asana API v1
MIT License
299 stars 103 forks source link

TagResponse color allowed_values should contain 'none' #184

Open thijsh opened 1 year ago

thijsh commented 1 year ago

Asana API responds with color: null when default grey tags are created. This gets translated to 'none', which seems to be by design. The correct behavior is to accept a value of 'none' as a valid tag color. The same allowed_values are listed in the project_response.py.

jv-asana commented 1 year ago

Hi @thijsh, I think this might be an API bug. The color options don't seem consistent with each other (i.e., the list of project colors and list of tag colors are different) OR it might be that they are using the same list of color but one endpoint returns "none" for grey and the other returns null for grey.

For Project default color of grey the API returns "none" For Tag default color of grey the API returns null

When the python library deserializes these values you will see that:

This is the correct behavior since we don't want the wrong mapping of null (None value) to "none" (String value) during deserialization