Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph
mavenArtifactId = microsoft-graph-core
mavenMajorVersion = 2
mavenMinorVersion = 0
mavenPatchVersion = 5
mavenPatchVersion = 6
mavenArtifactSuffix =

#These values are used to run functional tests
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {

dependencies {
// Include the sdk as a dependency
implementation 'com.microsoft.graph:microsoft-graph-core:2.0.5'
implementation 'com.microsoft.graph:microsoft-graph-core:2.0.6'
// This dependency is only needed if you are using the TokenCrendentialAuthProvider
implementation 'com.azure:azure-identity:1.3.1'
}
Expand All @@ -37,7 +37,7 @@ Add the dependency in `dependencies` in pom.xml
<!-- Include the sdk as a dependency -->
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph-core</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
<!-- This dependency is only needed if you are using the TokenCrendentialAuthProvider -->
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.IOException;
import java.lang.reflect.Field;

import javax.annotation.Nullable;
import javax.annotation.Nonnull;

import com.microsoft.graph.httpcore.middlewareoption.TelemetryOptions;
Expand All @@ -25,7 +24,7 @@ public class TelemetryHandler implements Interceptor{
/**
* Current SDK version
*/
public static final String VERSION = "v2.0.5";
public static final String VERSION = "v2.0.6";
/**
* Verion prefix
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package com.microsoft.graph.serializer;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.CaseFormat;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
Expand All @@ -35,7 +34,6 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -241,8 +239,9 @@ private void getChildAdditionalData(final Object serializableObject, final JsonE
if(outJson == null || serializableObject == null || !outJson.isJsonObject())
return;
final JsonObject outJsonObject = outJson.getAsJsonObject();
addAdditionalDataFromJsonObjectToJson(serializableObject, outJsonObject);
// Use reflection to iterate through fields for eligible Graph children
for (java.lang.reflect.Field field : serializableObject.getClass().getFields()) {
for (Field field : serializableObject.getClass().getFields()) {
try {
final Object fieldObject = field.get(serializableObject);
final JsonElement fieldJsonElement = outJsonObject.get(field.getName());
Expand Down Expand Up @@ -275,7 +274,7 @@ else if (fieldObject instanceof List && fieldJsonElement.isJsonArray()) {
} else if(fieldJsonElement.isJsonObject()) {
// If the object is a valid Graph object, add its additional data
final JsonObject fieldJsonObject = fieldJsonElement.getAsJsonObject();
addAdditionalDataFromJsonObjectToJson(fieldObject, fieldJsonObject);
getChildAdditionalData(fieldObject, fieldJsonObject);
}
} catch (IllegalArgumentException | IllegalAccessException e) {
logger.logError("Unable to access child fields of " + serializableObject.getClass().getSimpleName(), e);
Expand All @@ -294,7 +293,6 @@ private void addAdditionalDataFromJsonObjectToJson (final Object item, final Jso
final IJsonBackedObject serializableItem = (IJsonBackedObject) item;
final AdditionalDataManager itemAdditionalData = serializableItem.additionalDataManager();
addAdditionalDataFromManagerToJson(itemAdditionalData, itemJsonObject);
getChildAdditionalData(serializableItem, itemJsonObject);
}
}

Expand Down