Skip to content

Commit 51d5018

Browse files
committed
Code refactor and update public API interface
1 parent ea2d73f commit 51d5018

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Microsoft.OpenApi/Services/OperationSearch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override void Visit(OpenApiPathItem pathItem)
4141
var operation = item.Value;
4242
var operationType = item.Key;
4343

44-
if (_predicate(CurrentKeys.Path, CurrentKeys.Operation, operation))
44+
if (_predicate(CurrentKeys.Path, operationType, operation))
4545
{
4646
_searchResults.Add(new SearchResult()
4747
{
@@ -77,7 +77,7 @@ private static CurrentKeys CopyCurrentKeys(CurrentKeys currentKeys, OperationTyp
7777
return new CurrentKeys
7878
{
7979
Path = currentKeys.Path,
80-
Operation = operationType
80+
Operation = operationType,
8181
};
8282
}
8383
}

test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ namespace Microsoft.OpenApi.Services
10061006
public string Header { get; }
10071007
public string Link { get; set; }
10081008
public Microsoft.OpenApi.Models.OperationType? Operation { get; set; }
1009+
public System.Collections.Generic.IList<Microsoft.OpenApi.Models.OpenApiParameter> Parameters { get; set; }
10091010
public string Path { get; set; }
10101011
public string Response { get; set; }
10111012
public string ServerVariable { get; }
@@ -1111,14 +1112,15 @@ namespace Microsoft.OpenApi.Services
11111112
{
11121113
public OperationSearch(System.Func<string, Microsoft.OpenApi.Models.OperationType?, Microsoft.OpenApi.Models.OpenApiOperation, bool> predicate) { }
11131114
public System.Collections.Generic.IList<Microsoft.OpenApi.Services.SearchResult> SearchResults { get; }
1114-
public override void Visit(Microsoft.OpenApi.Models.OpenApiOperation operation) { }
1115+
public override void Visit(Microsoft.OpenApi.Models.OpenApiPathItem pathItem) { }
11151116
public override void Visit(System.Collections.Generic.IList<Microsoft.OpenApi.Models.OpenApiParameter> parameters) { }
11161117
}
11171118
public class SearchResult
11181119
{
11191120
public SearchResult() { }
11201121
public Microsoft.OpenApi.Services.CurrentKeys CurrentKeys { get; set; }
11211122
public Microsoft.OpenApi.Models.OpenApiOperation Operation { get; set; }
1123+
public System.Collections.Generic.IList<Microsoft.OpenApi.Models.OpenApiParameter> Parameters { get; set; }
11221124
}
11231125
}
11241126
namespace Microsoft.OpenApi.Validations

0 commit comments

Comments
 (0)