I have a webhook in Stripe that connects to an endpoint sending a Json in the body, however I'm not sure how to get that json using the google endpoints, since I understand that only manages pojos, I'm trying with the following:
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.stripe.model.Event;
import com.yogome.heroesofknowledge.rest.pojos.GenericResponse;
import com.yogome.heroesofknowledge.rest.pojos.Response;
import java.util.logging.Level;
import java.util.logging.Logger;
@Api(name = "eventos")
public class EventosEndpoint {
@ApiMethod(name = "guardar", httpMethod = "POST")
public Response guardar(Event event) {
Logger logger = Logger.getLogger(this.getClass().getName());
logger.log(Level.INFO, event.getType());
return new GenericResponse(event.getType());
}
}
But he does send me the following error:
com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backend method (SystemService.java:378) com.google.api.server.spi.response.BadRequestException: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.stripe.model.StripeObject, problem: abstract types need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
so I need a way to be able to either get the raw json or cast the event object.