I have written a java class to retrieve schema from schema registry using feignHttp. Above exception is thrown when I try to retrieve a schema.
Client class:
import com.google.gson.internal.LinkedTreeMap;
import feign.Feign;
import feign.FeignException;
import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder;
import feign.okhttp.OkHttpClient;
import org.apache.avro.Schema;
import org.apache.avro.SchemaParseException;
public class SchemaRegistryReader {
    public Schema getSchemaFromID(String registryURL, String schemaID) throws SchemaParseException, FeignException {
        SchemaRegistryClient registryClient = Feign.builder()
                .client(new OkHttpClient())
                .encoder(new GsonEncoder())
                .decoder(new GsonDecoder())
                .target(SchemaRegistryClient.class, registryURL);
        Object returnedSchema = registryClient.findByID(schemaID);
        LinkedTreeMap jsonSchemaObject = ((LinkedTreeMap) returnedSchema);
        String jsonSchema = jsonSchemaObject.get("schema").toString();
        return new Schema.Parser().parse(jsonSchema);
    }
}
Method Interface:
import feign.Headers;
import feign.Param;
import feign.RequestLine;
public interface SchemaRegistryClient {
    @RequestLine("GET")
    Object connect();
    @RequestLine("GET /schemas/ids/{id}")
    @Headers("Content-Type: application/json")
    Object findByID(@Param("id") String id);
}
Exception thrown:
java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to com.google.gson.internal.LinkedTreeMap at org.wso2.extension.siddhi.map.avro.util.schema.SchemaRegistryReader.getSchemaFromID(SchemaRegistryReader.java:41)
Would be great help if the cause for this can be found.
 
    