can't use Swashbuckle.AspNetCore.Swagger library

56 Views Asked by At

when trying to implement the Swashbuckle.AspNetCore.Swagger library, gets an error Error CS0246 The type or namespace name 'Operation' could not be found (are you missing a using directive or an assembly reference?)" when using "Operation"

I'm using .net 5

Code library implement

how can i fix this, as the library is already installed

1

There are 1 best solutions below

0
On BEST ANSWER

You should replace the class Operation with OpenApiOperation like this:

    public void Apply(OpenApiOperation operation, OperationFilterContext context)