Action bound to abstract entity type is not present in OpenAPI output when using hidi to convert from CSDL
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp, openapi
- Domain
- api, backend-api-design
Research direction
Reproduce the issue with the Hidi command using the referenced CSDL input and conversion-settings/openapi.json. Compare the generated YAML with the abstract protectionUnitBase actions and verify whether /offboard and /cancelOffboard are absent. Done means both request URIs appear in the OpenAPI output.
Written by the indexing model from the issue text.
Description
Describe the bug
When generating the OpenAPI description for Microsoft Graph Beta the offboard and cancelOffboard routes are not generated for the protectionUnit entity
Reproduction Steps
In a PowerShell terminal with dotnet 9
dotnet tool install --global Microsoft.OpenApi.Hidi
git clone https://github.com/microsoftgraph/msgraph-metadata.git
hidi transform --csdl .\msgraph-metadata\clean_beta_metadata\cleanMetadata.xml --output .\beta-enhanced-restore.yaml --co --version "3.0" --metadata-version "beta" --log-level Trace --format yaml --settings-path .\msgraph-metadata\conversion-settings\openapi.json
Alternatively if you clone the internal AD-AggregatorService-Workloads you can use a smaller source csdl file:
hidi transform --csdl .\AD-AggregatorService-Workloads\Workloads\Microsoft.EnhancedRestore\override\schema-Prod-beta.csdl --output .\beta-enhanced-restore-3.1.yaml --co --version "3.1" --metadata-version "beta" --log-level Trace --format yaml
When opening the newly created beta-enhanced-restore.yaml you will not find a path that includes /cancelOffboard
When examining the smaller CSDL fragment for the Microsoft.EnhancedRestore I can see that the impacted Actions are all bound to an abstract type.
<EntityType Name="protectionUnitBase" BaseType="microsoft.graph.entity" Abstract="true" >
<Property Name="policyId" Type="Edm.String" />
<Property Name="status" Type="self.protectionUnitStatus" />
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
<Property Name="createdBy" Type="microsoft.graph.identitySet" />
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" />
<Property Name="lastModifiedBy" Type="microsoft.graph.identitySet" />
<Property Name="protectionSources" Type="self.protectionSource" Nullable="false" />
<Property Name="error" Type="microsoft.graph.publicError" />
<Property Name="offboardRequestedDateTime" Type="Edm.DateTimeOffset" />
</EntityType>
<EntityType Name="protectionRuleBase" BaseType="microsoft.graph.entity" Abstract="true" >
<Property Name="status" Type="self.protectionRuleStatus" />
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
<Property Name="createdBy" Type="microsoft.graph.identitySet" />
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" />
<Property Name="lastModifiedBy" Type="microsoft.graph.identitySet" />
<Property Name="error" Type="microsoft.graph.publicError" />
<Property Name="isAutoApplyEnabled" Type="Edm.Boolean" />
</EntityType>
<Action Name="run" IsBound="true">
<Parameter Name="bindingParameter" Type="self.protectionRuleBase"/>
<ReturnType Type="self.protectionRuleBase"/>
</Action>
<Action Name="deleteAndUnprotect" IsBound="true" >
<Parameter Name="bindingParameter" Type="self.protectionRuleBase"/>
<ReturnType Type="self.protectionRuleBase"/>
</Action>
<Action Name="offboard" IsBound="true">
<Parameter Name="bindingParameter" Type="self.protectionUnitBase"/>
<ReturnType Type="self.protectionUnitBase"/>
</Action>
<Action Name="cancelOffboard" IsBound="true" >
<Parameter Name="bindingParameter" Type="self.protectionUnitBase"/>
<ReturnType Type="self.protectionUnitBase"/>
</Action>
Expected behavior
the /offboard and /cancelOffboard request URIs are described in the OpenAPI output.
Additional context
This is an issue preventing the generated SDKs for Microsoft Graph from including these requests.
- Dominant language
- C#
- Stars
- 240
- Forks
- 70
- Avg merge
- 7h 59m
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/OpenAPI.NET.OData
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/OpenAPI.NET.OData#661 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
microsoft/OpenAPI.NET.OData#852 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/OpenAPI.NET.OData#833 ·
-
status:needs-more-information
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/OpenAPI.NET.OData#723 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/OpenAPI.NET.OData#710 · 2 comments · 1 reaction ·
All issues in microsoft/OpenAPI.NET.OData
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·