File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
src/Microsoft.OpenApi.OData.Reader
test/Microsoft.OpenAPI.OData.Reader.Tests/Edm Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -597,6 +597,8 @@ private void RetrieveNavigationPropertyPaths(
597597 // append a navigation property key.
598598 if ( targetsMany )
599599 {
600+ CreateAlternateKeyPath ( currentPath , navEntityType ) ;
601+
600602 currentPath . Push ( new ODataKeySegment ( navEntityType ) ) ;
601603 AppendPath ( currentPath . Clone ( ) ) ;
602604
Original file line number Diff line number Diff line change 1515 <TargetFrameworks >netstandard2.0</TargetFrameworks >
1616 <PackageId >Microsoft.OpenApi.OData</PackageId >
1717 <SignAssembly >true</SignAssembly >
18- <Version >1.5.0-preview10 </Version >
18+ <Version >1.5.0-preview11 </Version >
1919 <Description >This package contains the codes you need to convert OData CSDL to Open API Document of Model.</Description >
2020 <Copyright >© Microsoft Corporation. All rights reserved.</Copyright >
2121 <PackageTags >Microsoft OpenApi OData EDM</PackageTags >
3131- Retrieves complex properties of derived types #437
3232- Updates operationIds of navigation property paths with OData type cast segments #442
3333- Generate navigation property paths defined in nested complex properties #446
34+ - Adds support for alternate keys to collection navigation properties #410
3435 </PackageReleaseNotes >
3536 <AssemblyName >Microsoft.OpenApi.OData.Reader</AssemblyName >
3637 <AssemblyOriginatorKeyFile >..\..\tool\Microsoft.OpenApi.OData.snk</AssemblyOriginatorKeyFile >
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public void GetPathsForGraphBetaModelReturnsAllPaths()
5252
5353 // Assert
5454 Assert . NotNull ( paths ) ;
55- Assert . Equal ( 16967 , paths . Count ( ) ) ;
55+ Assert . Equal ( 16976 , paths . Count ( ) ) ;
5656 AssertGraphBetaModelPaths ( paths ) ;
5757 }
5858
@@ -93,6 +93,10 @@ private void AssertGraphBetaModelPaths(IEnumerable<ODataPath> paths)
9393 // Test that navigation properties within nested complex properties are appended
9494 Assert . NotNull ( paths . FirstOrDefault ( p => p . GetPathItemName ( ) . Equals (
9595 "/identity/authenticationEventsFlows({id})/conditions/applications/includeApplications" ) ) ) ;
96+
97+ // Test that alternate keys are appended for collection navigation properties
98+ Assert . NotNull ( paths . FirstOrDefault ( p => p . GetPathItemName ( ) . Equals (
99+ "/employeeExperience/learningProviders({id})/learningContents(externalId='{externalId}')" ) ) ) ;
96100 }
97101
98102 [ Fact ]
@@ -113,7 +117,7 @@ public void GetPathsForGraphBetaModelWithDerivedTypesConstraintReturnsAllPaths()
113117
114118 // Assert
115119 Assert . NotNull ( paths ) ;
116- Assert . Equal ( 17618 , paths . Count ( ) ) ;
120+ Assert . Equal ( 17627 , paths . Count ( ) ) ;
117121 }
118122
119123 [ Theory ]
You can’t perform that action at this time.
0 commit comments