-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for composable functions #431
Conversation
Generate ODataPath for composable functions
Proposal of a fix for #402. Now,
Example from Graph API v1.0 metadata.xml
If functions are composable, they can be chained
I have a restriction that only one operation segment can be appended It's not a fix for #404 which is a case when a navigation segment is added to the operation segment I can add the navigation segment
but OpenAPI.NET.OData/src/Microsoft.OpenApi.OData.Reader/PathItem/OperationPathItemHandler.cs Line 75 in aaa82b3
|
…ation's return type
The second commit contains fix for #404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great contribution! In addition to my comments, could you add unit tests for the case you're implementing please?
Improve appending to composable functions
Added unit test and small changes to ensure that operations are appended to all composable functions, and navigation properties are appended to functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes! @irvinesunday for final review and merge
Wanted to add this diff screenshot for informational purposes. The diff image above shows the current number of paths per API generated using the Kiota-based CSDL for v1.0. Below is a similar diff but using the non Kiota-based CSDL (PowerShell and Graph Explorer) Left is current production figures, right is with the changes in this PR. drives API seem to have grown by quite a huge margin. We may need to investigate the accuracy of the operations bound to the drives API and and fix them in the metadata if necessary before merging this PR. |
@MartinM85 do you mind updating the release notes and bumping up the version in the csproj file? |
Update release notes
@irvinesunday Version and release notes updated |
Investigation to the growth in the |
@irvinesunday, thanks for double checking. Did you have to make any changes to the metadata? Any changes we should make to the test CSDLs here considering the bigger increase in path items? (see the integration tests numbers) |
No, I didn't make any changes to the metadata. The integration file is probably falling behind the main metadata file in terms of annotations. |
@irvinesunday would you mind having a quick look at those to check if something obvious comes up? (like a wrong contains target or a missing annotation) so we can keep those numbers down? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone for the work on this one.
@irvinesunday for final review and merge.
@baywet our biggest culprit was a containment for a <NavigationProperty Name="deletedItems" Type="Collection(graph.directoryObject)" ContainsTarget="true">
<Annotation Term="Org.OData.Validation.V1.DerivedTypeConstraint">
<Collection>
<String>microsoft.graph.user</String>
<String>microsoft.graph.group</String>
<String>microsoft.graph.application</String>
</Collection>
</Annotation>
<Annotation Term="Org.OData.Core.V1.ExplicitOperationBindings">
<Collection>
<String>microsoft.graph.restore</String>
</Collection>
</Annotation>
</NavigationProperty> Removing the containment (as we've done in our prod files) lowers the path numbers here significantly. |
fixes #402
fixes #404
Generate ODataPath for composable functions