Skip to content

Commit

Permalink
Use dynamic IOperationProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeiPavlov committed Dec 11, 2024
1 parent 43e78db commit 2bd5669
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file="WebApiToSwaggerGenerator.cs" company="NSwag">
// Copyright (c) Rico Suter. All rights reserved.
// </copyright>
Expand Down Expand Up @@ -255,9 +255,9 @@ private bool RunOperationProcessors(OpenApiDocument document, Type controllerTyp

foreach (dynamic attribute in operationProcessorAttribute)
{
var operationProcessor = ObjectExtensions.HasProperty(attribute, "Parameters") ?
(IOperationProcessor)Activator.CreateInstance(attribute.Type, attribute.Parameters) :
(IOperationProcessor)Activator.CreateInstance(attribute.Type);
dynamic operationProcessor = ObjectExtensions.HasProperty(attribute, "Parameters") ?
Activator.CreateInstance(attribute.Type, attribute.Parameters) :
Activator.CreateInstance(attribute.Type);

if (operationProcessor.Process(context) == false)
{
Expand Down

0 comments on commit 2bd5669

Please sign in to comment.