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

Format OData cast operationIds #1487

Merged
merged 3 commits into from
Apr 17, 2023
Merged

Format OData cast operationIds #1487

merged 3 commits into from
Apr 17, 2023

Conversation

peombwa
Copy link
Member

@peombwa peombwa commented Apr 11, 2023

Overview

This PR fixes #1228 by ensuring OData cast operationIds are resolved to format that can be interpreted by AutoREST. This is done by merging [ACTION] and [AS_CAST_TYPE] segments on an OData cast operationId. For example:

  • directory.ListDeletedItems.AsApplication -> directory_ListDeletedItemsAsApplication -> Get-MgDirectoryDeletedItemAsApplication.

This PR is a continuation of microsoftgraph/msgraph-metadata#317.

Testing Instructions

  • See unit tests.

timayabi2020
timayabi2020 previously approved these changes Apr 11, 2023
@irvinesunday
Copy link
Collaborator

Other than the nitpick typo, this LGTM. However, we could accomplish the same by pushing a small change in the conversion lib. See: https://github.com/microsoft/OpenAPI.NET.OData/blob/ef336182076c8a7372af815df71d25d1be04de81/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs#L179

@peombwa
Copy link
Member Author

peombwa commented Apr 12, 2023

Other than the nitpick typo, this LGTM. However, we could accomplish the same by pushing a small change in the conversion lib. See: https://github.com/microsoft/OpenAPI.NET.OData/blob/ef336182076c8a7372af815df71d25d1be04de81/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs#L179

Yes, let's tackle that as part of microsoft/OpenAPI.NET.OData#361. All operationIds should be standardized in the conversion lib.

irvinesunday
irvinesunday previously approved these changes Apr 13, 2023
@sonarcloud
Copy link

sonarcloud bot commented Apr 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@peombwa peombwa merged commit c3cfdd3 into dev Apr 17, 2023
@peombwa peombwa deleted the po/FormatODataCastOperationId branch April 17, 2023 17:15
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.

Enable OData Cast Paths for PowerShell Style
4 participants