0

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!

JustinC
  • 1
  • 1
  • 1
  • Do you see the error when dig into this code `(Microsoft.Azure.ActiveDirectory.GraphClient.Group)(value)`? – Jambor - MSFT Feb 02 '17 at 02:14
  • @Jambor-MSFT no, the object itself is populated: {Microsoft.Azure.ActiveDirectory.GraphClient.Group} base: {Microsoft.Azure.ActiveDirectory.GraphClient.Group} _appRoleAssignments: Count = 2 _appRoleAssignmentsFetcher: null _description: "sample string 1" _dirSyncEnabled: true _displayName: "sample string 2" – JustinC Feb 06 '17 at 17:27
  • @Jambor-MSFT I would provide the whole object but it's too long for the comment section. – JustinC Feb 06 '17 at 17:27

0 Answers0