-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
MS return JSON "@odata.type":"#Microsoft.Graph.Message" in some messages, and conversion to proper package class will fail. It is not on DefaultSerializer.
Package name should be lowercase.
final String derivedType = (odataType.substring(0, lastDotIndex).toLowerCase()@Test
public void fail() throws ClassNotFoundException {
String odataType = "#Microsoft.Graph.Message";
final int lastDotIndex = odataType.lastIndexOf(".");
final String derivedType = (odataType.substring(0, lastDotIndex) +
".models." +
CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL,
odataType.substring(lastDotIndex + 1)))
.replace("#", "com.");
Class<?> derivedClass = Class.forName(derivedType);
System.out.println(derivedClass);
}
@Test
public void pass() throws ClassNotFoundException {
String odataType = "#Microsoft.Graph.Message";
final int lastDotIndex = odataType.lastIndexOf(".");
final String derivedType = (odataType.substring(0, lastDotIndex).toLowerCase() +
".models." +
CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL,
odataType.substring(lastDotIndex + 1)))
.replace("#", "com.");
Class<?> derivedClass = Class.forName(derivedType);
System.out.println(derivedClass);
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working