Skip to content

Commit

Permalink
Merge pull request #1 from nagarockset/master
Browse files Browse the repository at this point in the history
Handled UnrecognizedPropertyException error on okhttp ApiClient.
  • Loading branch information
kwadhwa18 committed Feb 24, 2021
2 parents 5dd0129 + fd10c1d commit 466c6c4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package {{invokerPackage}};
import com.rockset.client.model.ErrorModel;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.squareup.okhttp.*;
import com.squareup.okhttp.internal.http.HttpMethod;
import com.squareup.okhttp.logging.HttpLoggingInterceptor;
Expand Down Expand Up @@ -920,6 +921,7 @@ public class ApiClient {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
errorModel = objectMapper.readValue(respBody, ErrorModel.class);
} catch (final IOException e) {
Expand Down

0 comments on commit 466c6c4

Please sign in to comment.