-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Prerequisites
- I have searched the repository’s issues and Kinde community to ensure my issue isn’t a duplicate
- I have checked the latest version of the library to replicate my issue
- I have read the contributing guidelines
- I agree to the terms within the code of conduct
Describe the issue
The Kinde Management API returns HTTP 200 OK for successful create operations (users and organizations), but the SDK's RESPONSE_TYPES mapping only includes 201 status codes. This causes the SDK to return None instead of deserializing the response data.
Affected Operations
create_user()- ReturnsNoneinstead ofCreateUserResponsecreate_organization()- ReturnsNoneinstead ofCreateOrganizationResponse
Expected Behavior
When creating a user or organization successfully, the SDK should return a properly deserialized response object containing the created resource data (e.g., id for users, organization.code for organizations).
Actual Behavior
The SDK returns None because the response status code 200 is not mapped in the RESPONSE_TYPES dictionary, only 201 is mapped.
Root Cause
In ManagementClient, the RESPONSE_TYPES dictionary at initialization only maps status code 201 for create operations:
"users": {
"create": {
"201": "CreateUserResponse" # Only 201 is mapped
}
}Reproduction
from kinde_sdk.management import ManagementClient
client = ManagementClient(
domain="your-domain.kinde.com",
client_id="your_client_id",
client_secret="your_client_secret"
)
# This returns None instead of CreateUserResponse
response = client.create_user(
email="[email protected]",
given_name="Test",
family_name="User"
)
print(response) # Output: None (should be CreateUserResponse object)Current Workaround
We're manually adding the 200 status code mapping after client initialization:
client.RESPONSE_TYPES["users"]["create"]["200"] = "CreateUserResponse"
client.RESPONSE_TYPES["organizations"]["create"]["200"] = "CreateOrganizationResponse"
Library URL
https://github.com/kinde-oss/kinde-python-sdk
Library version
2.2.0
Operating system(s)
Other Linux
Operating system version(s)
Docker Conatiner python:3.13-slim
Further environment details
No response
Reproducible test case URL
No response
Additional information
No response