Error When Web API Help Tries to Deserialize Microsoft Azure AD Graph API Group

309 views Asked by At

When I try to access the Help Area for my Web API 2 application, the HelpPageSampleGenerator is throwing an exception in the WriteSampleObjectsUsingFormatter method in the last line of the quoted code below when trying to deserialize a Group from the Azure AD Graph API:

        object sample = String.Empty;
        MemoryStream ms = null;
        HttpContent content = null;
        try
        {
            if (formatter.CanWriteType(type))
            {
                ms = new MemoryStream();
                content = new ObjectContent(type, value, formatter, mediaType);
                formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();

Other classes (including those with nested classes) deserialize fine. I dug into the default object for a Group ("value" in the method call) and I do see this:

Microsoft.Azure.ActiveDirectory.GraphClient.IGroupFetcher.AppRoleAssignments = '((Microsoft.Azure.ActiveDirectory.GraphClient.Group)(value)).Microsoft.Azure.ActiveDirectory.GraphClient.IGroupFetcher.AppRoleAssignments' threw an exception of type 'System.NullReferenceException'

Since this is all Microsoft's code I don't think it's anything I'm doing. I'd really rather not have to write my own classes to parse into the Graph API's if I don't have to, but I will if there's no other work around.

Thanks!

0

There are 0 answers