launchdarkly / api-client-python

LaunchDarkly API Client for Python
Other
5 stars 8 forks source link

CustomRolesApi get role has a defect in it where the returned string gives policy attribuete not_resources instead of notResources #16

Closed painbank closed 11 months ago

painbank commented 1 year ago
        api_instance = custom_roles_api.CustomRolesApi(api_client)
        role = api_instance.get_custom_role(role_key)

string has incorrect return string in it. Might be a LD server side issue verse the python library issue, however using Insomnia and a direct REST call, the return type is correct.

the Statement object looks to be incorrect: https://github.com/launchdarkly/api-client-python/blob/main/docs/Statement.md

and should be fixed.

https://github.com/launchdarkly/api-client-python/blob/main/launchdarkly_api/model/statement.py

lucywyman commented 11 months ago

Hmmm, this looks to be an issue with several keys (base_permission as well), and in other API clients too (I see the Ruby client has the same issue). I'm curious if using the underscored keys in a POST request to create or update the role works? I'd assume it does if the model itself is "wrong" - in which case I'm not sure I'd consider this a bug.

lucywyman commented 11 months ago

Ok, confirmed this is expected behavior for API client libraries to adhere to language conventions, and we don't expect objects to match raw API call responses. Going to close this as won't do, but please re-open if there's something you're trying to do that this is preventing you from doing!