Skip to content

How to Resolve Issues in Fineract SDK

Aditya Gupta edited this page Jan 30, 2025 · 2 revisions

Resolving Data Type Errors in Fineract SDK Models

If you encounter data type errors while using the Fineract SDK, there's no need to modify the SDK client directly. Instead, you can resolve the issue by modifying the model class in the Fineract-client-kmp.

Steps to Fix Data Type Errors:

Locate the Model Class:

  • Navigate to the Fineract-client-kmp repository.
  • Go to the src folder, where the models are located.
  • Search for the specific model class that is throwing the data type error.

Modify the Data Type:

  • Once you locate the model, you'll find the properties or fields of the class.
  • Change the data type of the field to the appropriate type.

Example:

Let’s say you're getting an error related to a String type in a model but it should be an Integer. Here's how you can fix it:

Before Fix:

   data class UserModel(
       userId: string;  // Error: Type 'string' is not assignable to type 'number'.
       username: string;
       email: string;
   )

After Fix:

   data class UserModel(
       userId: number;  // Fixed the type to 'number'.
       username: string;
       email: string;
   )

Key Notes:

  • Always ensure that the data type you're changing it to matches the expected structure and constraints of the API or database you're working with.
  • This change only affects the Fineract Client package, so the SDK client remains unaffected.

By making this adjustment directly in the model class, you can avoid issues without needing to touch the SDK code itself.