Unchase.Swashbuckle.AspNetCore.Extensions icon indicating copy to clipboard operation
Unchase.Swashbuckle.AspNetCore.Extensions copied to clipboard

Swashbuckle 10 Compatibility.

Open niemyjski opened this issue 2 months ago • 4 comments

I just tried upgrading one of my apps and noticed that there are compatibility changes with this library:

Unable to load one or more of the requested types.
Method 'Apply' in type 'Unchase.Swashbuckle.AspNetCore.Extensions.Filters.AppendActionCountToTagSummaryDocumentFilter' from assembly 'Unchase.Swashbuckle.AspNetCore.Extensions, Version=2.7.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Method 'Apply' in type 'Unchase.Swashbuckle.AspNetCore.Extensions.Filters.ChangeResponseByHttpStatusCodeDocumentFilter`1' from assembly 'Unchase.Swashbuckle.AspNetCore.Extensions, Version=2.7.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

I just wanted to log this in case any one else is running into this and has time to submit a pr.

niemyjski avatar Nov 13 '25 07:11 niemyjski

We are facing the same Issue. We were only using the AddEnumsWithValuesFixFilters from this library. Removing this line of code makes our application work again.

btastic avatar Nov 13 '25 09:11 btastic

Same issue for me. I was looking at Microsoft.AspNetCore.OpenApi to see if there was a way to write a transformer to do the same, but I'm having issues.

frederikstonge avatar Nov 19 '25 01:11 frederikstonge

I've encountered the same issue in my own filters. The problem is that OpenApiOperation has moved from Microsoft.OpenApi.Models to Microsoft.OpenApi. In fact models sub namespace has completely gone

So if you recompile against the latest swashbuckle and replace "using Micrsosoft.OpenApi.Models" with "using Microsoft.OpenApi" it "should" work. I'm not free this weekend to compile and submit a pull request with the changes. I will look at doing it next week unless someone beats me to it.

tankbob avatar Nov 21 '25 14:11 tankbob

I've encountered the same issue in my own filters. The problem is that OpenApiOperation has moved from Microsoft.OpenApi.Models to Microsoft.OpenApi. In fact models sub namespace has completely gone

So if you recompile against the latest swashbuckle and replace "using Micrsosoft.OpenApi.Models" with "using Microsoft.OpenApi" it "should" work. I'm not free this weekend to compile and submit a pull request with the changes. I will look at doing it next week unless someone beats me to it.

Not that easy unfortunately. Microsoft heavily changed their API's. It is difficult to migrate to their new library if you don't know what you are doing.

btastic avatar Nov 21 '25 15:11 btastic