Skip to content

Commit 769bdd0

Browse files
committed
Merge branch 'main' into feat/upgrade-oai
2 parents 269c0d5 + 2f6459e commit 769bdd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,9 @@ private void CreateAlternateKeyPath(ODataPath currentPath, IEdmEntityType entity
702702
IEnumerable<IDictionary<string, IEdmProperty>> alternateKeys = _model.GetAlternateKeysAnnotation(entityType);
703703
foreach (var keyDict in alternateKeys)
704704
{
705+
if (keyDict.Where(static x => x.Value is not null).ToDictionary(static k => k.Key, static v => v.Value.Name) is not { Count: > 0 } keyMappings)
706+
continue;
705707
ODataPath keyPath = currentPath.Clone();
706-
IDictionary<string, string> keyMappings = keyDict.ToDictionary(static k => k.Key, static v => v.Value.Name);
707708
ODataKeySegment keySegment = new(entityType, keyMappings)
708709
{
709710
IsAlternateKey = true

0 commit comments

Comments
 (0)