{
"first_name": "yy",
"last_name": "uu",
"mobile": "123456",
"email": "qwerty32@g.com",
"user_type":"user",
"bio": "hell",
"expertise_json": {"0":"1", "1":"2"}
}
This is the Josn i have to send, My java classe for this user:
public class User {
@SerializedName("email")
private String userEmail;
@SerializedName("password")
private String userPassword;
@SerializedName("first_name")
private String userFirstName;
@SerializedName("last_name")
private String userLastName;
@SerializedName("mobile")
private String userMobile;
@SerializedName("user_type")
private String userType;
@SerializedName("expertise_json")
@Expose
private HashMap<String,String> userExpertise;
@SerializedName("bio")
private String bio;
}
public interface ApiInterface {
@POST("register")
Call<User> createUser(@Body User user);
@GET("init")
Call<Expertises> getExpertise();
}
everything is saving to server except expertise_json. Also expertise_json is dynamic not limited to 2 or 3 values but can be any 10 20 etc. Any help will be highly appreciated. Thank you