Skip to content
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

Missing $ref paths for DELETE operations #567

Closed
peombwa opened this issue May 12, 2021 · 12 comments · Fixed by microsoft/OpenAPI.NET.OData#112
Closed

Missing $ref paths for DELETE operations #567

peombwa opened this issue May 12, 2021 · 12 comments · Fixed by microsoft/OpenAPI.NET.OData#112
Assignees
Labels
dependency: OpenAPI.NET.OData Tasks targeting the OpenAPI.NET.OData library

Comments

@peombwa
Copy link
Member

peombwa commented May 12, 2021

A number of paths are missing $ref paths for DELETE operation. e.g.
image

Some of the missing $ref paths are:

  • DELETE /applications/{application-id}/owners/$ref - docs.
  • DELETE /groups/{group-id}/members/{member-id}/$ref - docs.
  • DELETE /groups/{group-id}/owners/{owner-id}/$ref - docs.

Related to:

AB#9454

@darrelmiller
Copy link
Contributor

The first example is broken because you should not be able to delete a collection.
The other two examples are not generated because they are containsTarget=false and we don't expand those. We can't do any better until we get a IndexableByKey capability annotation in the metadata for all navigation properties to collections.

@peombwa
Copy link
Member Author

peombwa commented May 22, 2021

@darrelmiller My bad, I used the wrong example for the first one. We are missing DELETE /applications|servicePrincipals/{id}/owners/{id}/$ref - docs.

@peombwa
Copy link
Member Author

peombwa commented May 24, 2021

Also missing:

  • DELETE /servicePrincipals/{id}/claimsMappingPolicies/{id}/$ref

@Shjokie Shjokie added the dependency: OpenAPI.NET.OData Tasks targeting the OpenAPI.NET.OData library label May 26, 2021
@peombwa
Copy link
Member Author

peombwa commented Jul 15, 2021

@darrelmiller Isn't IndexableByKey=true by default? See https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.xml#L303. This means that we should already be treating all navigation properties to collection that do not have IndexableByKey annotation as IndexableByKey=true in OpenAPI.NET.OData lib. I'm not sure if this is the case.

Also, OpenAPI.NET.OData should be updated to include DELETE ~/entityset/{key}/collection-valued-Nav/{navKey}/$ref for case where IndexableByKey=true and a navigation property is non-contained since this is what MS Graph uses - https://github.com/microsoft/OpenAPI.NET.OData/blob/master/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs#L274-L302.

cc\ @irvinesunday

@irvinesunday irvinesunday added this to the 1.6 milestone Jul 19, 2021
@irvinesunday
Copy link
Contributor

@darrelmiller Isn't IndexableByKey=true by default? See https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.xml#L303. This means that we should already be treating all navigation properties to collection that do not have IndexableByKey annotation as IndexableByKey=true in OpenAPI.NET.OData lib. I'm not sure if this is the case.

Also, OpenAPI.NET.OData should be updated to include DELETE ~/entityset/{key}/collection-valued-Nav/{navKey}/$ref for case where IndexableByKey=true and a navigation property is non-contained since this is what MS Graph uses - https://github.com/microsoft/OpenAPI.NET.OData/blob/master/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs#L274-L302.

cc\ @irvinesunday

You're right @peombwa, the OpenAPI.NET.OData lib. treats all navigation properties to collection that do not have the IndexableByKey annotation as IndexableByKey=true, see: https://github.com/microsoft/OpenAPI.NET.OData/blob/e8ecb37c96e42b3c744bbbe5430428134b9906de/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs#L273-L274

And yes, we should be generating the paths ~/entityset/{key}/collection-valued-Nav/{navKey}/$ref here: https://github.com/microsoft/OpenAPI.NET.OData/blob/e8ecb37c96e42b3c744bbbe5430428134b9906de/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs#L278-L283

@maisarissi
Copy link

Hi @irvinesunday .

The DELETE operation is still missing in the OpenAPI document.

@ryanchrisw
Copy link

Any updates on this?

@adhiambovivian
Copy link

@maisarissi @ryanchrisw this has been resolved in the OData library version 1.0.10.

@ryanchrisw
Copy link

ryanchrisw commented Mar 8, 2022

adhiambovivian please see Missing cmdlet: Remove-MgGroupMember there is definitely something still missing.

@maisarissi
Copy link

Hi @ryanchrisw . We have a tool chain when generating the PS SDK. So, the OData lib version 1.0.10 (which @adhiambovivian pointed out that fixes this issues) was released, but we still need to update the tool that converts OData to OpenAPI so the PS SDK can use the updated OpenAPI document in its generation.

@maisarissi
Copy link

Depends on #902.

@peombwa
Copy link
Member Author

peombwa commented Jun 27, 2022

Remove-Mg* commands are now available as of https://github.com/microsoftgraph/msgraph-sdk-powershell/releases/tag/1.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency: OpenAPI.NET.OData Tasks targeting the OpenAPI.NET.OData library
Projects
None yet
7 participants