Open sa-obgit-backend opened 8 months ago
Hi @sa-obgit-backend Thanks for using the Java SDK and for reaching out. Can you also share how you initialize the Drive object please? (anonymize any data)
Yes sure, nothing special here.
GET direct via CURL/Postman against official Graph endpoint. Then you get a JSON like
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity",
"createdDateTime": "2021-09-19T00:09:39Z",
"description": "xxx",
"id": "xxx",
...
"createdBy": {
"user": {
"displayName": "xxx"
}
},
"lastModifiedBy": {
"user": {
"email": "xxx",
"id": "xxx",
"displayName": "xxx"
}
},
"owner": {
"group": {
"email": "xxx",
"id": "xxx",
"displayName": "xxx"
}
},
"quota": {
...
}
}
and then you can convert to a drive object via
ParseNode driveParseNode =
new JsonParseNodeFactory().getParseNode("application/json", new ByteArrayInputStream(responseString.getBytes(StandardCharsets.UTF_8)));
com.microsoft.graph.models.Drive graphDrive = driveParseNode.getObjectValue(com.microsoft.graph.models.Drive::createFromDiscriminatorValue);
Then you have conversion unit test that principally works directionally (normally if no error occurs)
Serialization of an Graph Drive will lead to an error:
I think because of the Code in Drive:
There is an owner defined and linked to IdentitySet but in IdentitySet:
There is no "group" -> error
Perhaps there are more missing "IdentitySet" object, but I think at least group is missing
Expected behavior
The serialization works and gives JSON from the Microsoft object
Actual behavior
IllegalStateException at serialization
Steps to reproduce the behavior
will explode at