OfficeDev/hands-on-labs

03653-18, 03653-20 Model file

Closed this issue · 6 comments

Module Number: 03653-18, 03653-20
Module Title: Microsoft Graph People API, Insights from Microsoft Graph
Path of file:

Both of the labs generate their client-side model file from https://graph.microsoft.com/beta/$metadata. It worked a few days back but it looks like 4 new functions have been added to the schema recently and I think they invalidate Function overload rules in the OData v4.0 spec. This means that the generated Graph.cs file now has 2 sets of 2 functions with the same signature and the solution doesn't build:

error CS0111: Type 'Chart' already defines a member called 'Image' with the same parameter types

I don't get this error on any of the solutions I have from the last week. Nor do they contain definition for the methods in their Graph.cs file, so they've probably just been added.

This either needs a quick fix on the Microsoft Graph side (if that's even possible on such a short notice and if it's actually considered a bug from their perspective). Or we need to come up with an alternative. The upside of the approach in the labs was that it made them significantly shorter.

One alternative could be just rewriting the labs to some extent and have users create the models themselves. This makes the labs significantly longer though. Or we just provide them a working version of the Graph.cs file, which isn't very nice as we'd just hand them the model.

@mattgeim owns the SDKs. i suspect our labs need to change to point to nuget packages that are public now and not use the prview that is in the VM.

@jakubcech the .net sdk we used doesn't support beta, only v1.0 endpoint. Are you generating your own SDK? or trying to use the one we've shared?

Yeah @mattgeim, this is an issue with labs that aren't using the SDK and are using the beta endpoint. So the issue is in non-OData-compliant API in the beta namespace.

Edit: so what I was trying to say is that there's nothing to worry when it comes to the SDKs as they have nothing to do with this. Thanks!

@jthake let me know if you need me to chase anyone in Redmond for you

OK, this should be resolved in an hour or two by an update to the beta schema. I tested the model that gets currently generated in StagingBeta and it generated a Graph.cs file that compiles.

I'll validate this once again before tomorrow morning.

The current schema on the beta endpoint no longer contains non-compliant functions and generates a buildable .cs file in labs 03653-18 and 03653-20. This required no change in the labs themselves and was possible thanks to a call from the Excel team that they don't require the functions for //Build.