Skip to content

Replaces graph.report return type with Edm.Stream return type for matching Functions - #213

Merged
Irvine Sunday (irvinesunday) merged 3 commits into
masterfrom
is/graph-report-to-edm-stream
Oct 19, 2022
Merged

Irvine Sunday (irvinesunday) merged 3 commits into
masterfrom
is/graph-report-to-edm-stream

Conversation

@irvinesunday

Copy link
Copy Markdown
Contributor

Fixes #140

  • Replaces graph.report return type with Edm.Stream return type for functions with a return type of graph.report.

@baywet

Copy link
Copy Markdown
Member

(thanks for tackling this one)

<Parameter Name="incompatibleAccessPackageId" Type="Edm.String" Unicode="false" />
<ReturnType Type="Collection(graph.accessPackageAssignment)" />
</Function>
<Function Name="deviceConfigurationDeviceActivity" IsBound="true" IsComposable="true">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, can a function that returns an OData primitive (stream in this case) be composable? In my head a primitive can't have any paths expanded from it.

This would help me figure out the right way to fix the upcoming generation tomorrow as this change breaks the expectation at the link below which tries to cast the return type to a complex object.

https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator/blob/5c299f00196ef8a8ba9a0050614d3fe771963da4/src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs#L733

cc Vincent Biret (@baywet) Darrel (@darrelmiller) Irvine Sunday (@irvinesunday)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expansion and composition are semantically different. The former requires a complex/entity type with complex properties, the latter just another function that targets the type.
There's no reason semantically speaking why I couldn't have a "countbytes" function that binds to EDM stream. In practice I don't think I've seen bindings to primitive types however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report functions return type is wrong for a lot of reports

3 participants