openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbNativeJsonReader.java
public final NativeResponse.Builder readNativeResponse(JsonParser par) throws IOException {
    if (emptyToNull(par)) {
      return null;
    }
    NativeResponse.Builder resp = NativeResponse.newBuilder();
    boolean rootNativeField = false;
    boolean firstField = true;
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        if (firstField) {
          firstField = false;
          if ((rootNativeField = "native".equals(fieldName)) == true) {
            startObject(par);
            fieldName = getCurrentName(par);
            par.nextToken();
          }
        }
        if (par.getCurrentToken() != JsonToken.VALUE_NULL) {
          readNativeResponseField(par, resp, fieldName);
        }
      }
    }
    if (rootNativeField && !endObject(par)) {
      par.nextToken();
    }
    return resp;
  }
public final NativeResponse.Builder readNativeResponse(JsonParser par) throws IOException {
    if (emptyToNull(par)) {
      return null;
    }
    NativeResponse.Builder resp = NativeResponse.newBuilder();
    boolean rootNativeField = false;
    boolean firstField = true;
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        if (firstField) {
          firstField = false;
          if ((rootNativeField = "native".equals(fieldName)) == true) {
            startObject(par);
            fieldName = getCurrentName(par);
            par.nextToken();
          }
        }
        if (par.getCurrentToken() != JsonToken.VALUE_NULL) {
          readNativeResponseField(par, resp, fieldName);
        }
      }
    }
    if (rootNativeField && !endObject(par)) {
      par.nextToken();
    }
    return resp;
  }
Desserializes a {@link NativeResponse} from JSON, with a provided {@link JsonParser}
which allows several choices of input and encoding.