Skip to content

Commit 9423b95

Browse files
committed
fix: missing query parameters for $count operations
Signed-off-by: Vincent Biret <[email protected]>
1 parent 340ffb5 commit 9423b95

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Microsoft.OpenApi.OData.Reader/Operation/DollarCountGetOperationHandler.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,15 @@ protected override void SetParameters(OpenApiOperation operation)
170170
{
171171
base.SetParameters(operation);
172172

173-
if (annotatable == null)
174-
{
175-
return;
176-
}
177-
178173
OpenApiParameter parameter;
179174

180-
parameter = Context.CreateSearch(TargetPath, _document) ?? Context.CreateSearch(annotatable, _document);
175+
parameter = Context.CreateSearch(TargetPath, _document) ?? (annotatable is null ? null : Context.CreateSearch(annotatable, _document));
181176
if (parameter != null)
182177
{
183178
operation.Parameters.Add(parameter);
184179
}
185180

186-
parameter = Context.CreateFilter(TargetPath, _document) ?? Context.CreateFilter(annotatable, _document);
181+
parameter = Context.CreateFilter(TargetPath, _document) ?? (annotatable is null ? null : Context.CreateFilter(annotatable, _document));
187182
if (parameter != null)
188183
{
189184
operation.Parameters.Add(parameter);

0 commit comments

Comments
 (0)