okta / okta-sdk-python

Apache License 2.0
239 stars 142 forks source link

Fix UserProfile Custom Attributes casing #341

Closed justinabrokwah-okta closed 1 year ago

justinabrokwah-okta commented 1 year ago

Paginated results was re-formatting results before creating an object out of them to return through the method - in the case of user profile and custom attributes, custom attributes with a variable name starting with a capital letter, it would make the first letter lowercase instead

This PR removes that reformatting call thus resolving the issue

Used following code snippet to test and verify custom attributes are printed correctly:

# verify pagination issue is fixed
limit_params = {"limit": 1}
    users, resp, err = await okta_client.list_users(query_params=limit_params)
    for user in users:
        # print(user.id, user.profile.first_name, user.profile.last_name)
        print(user.profile)
    while resp.has_next():
        users, err = await resp.next()
        for user in users:
            # print(user.id, user.profile.first_name, user.profile.last_name)
            print(user.profile)

# verify issue is resolved in schema
user_schema, resp, err = await okta_client.get_user_schema('default')
    print(user_schema)