You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Failed to load API definition.` message is displayed on the Swagger Generation page(usually `localhost:port/swagger`).
30
+
A `Failed to load API definition.` message is displayed on the Swagger UI Generation page(usually at `https://localhost:port/swagger`).
31
31
32
32
There may also be a short error on the page about being unable to fetch `swagger.json`.
33
33
@@ -71,81 +71,40 @@ System.InvalidOperationException: The method 'get' on path '/api/ReportDesignerC
71
71
72
72
## Cause
73
73
74
-
There is a confliction method/path in ReportDesignerController. Swagger requires actions to have unique methods/paths.
74
+
There are conflicting methods/paths in the [ReportsController](/api/telerik.reporting.services.webapi.reportscontrollerbase) and [ReportDesignerController](/api/telerik.webreportdesigner.services.controllers.reportdesignercontrollerbase) controllers, as well as some `Obsolete` Actions. Swagger requires actions to have unique methods/paths, and by default - no `Obsolete` actions are accepted.
75
75
76
76
## Solution
77
77
78
78
### Swashbuckle
79
79
80
-
- For .NET Core 3.1 and .NET 5, configure the Swagger Generation in **Startup.cs**:
80
+
Configure the following Swagger UI Generation configuration in the **Program.cs**/**Startup.cs** file of the project:
Implement the `NSwag.Generation.Processors.IOperationProcessor` interface as follows and then use it in the `AddSwaggerGen` configuration:
93
+
The [ReportsController](/api/telerik.reporting.services.webapi.reportscontrollerbase) should work normally with **NSwag**. However, if the [ReportDesignerController](/api/telerik.webreportdesigner.services.controllers.reportdesignercontrollerbase) is used, it should be ignored by the Swagger generation tool by attaching to it the `[ApiExplorerSettings(IgnoreApi = true)]` attribute:
*[Get started with NSwag and ASP.NET Core]([https://stackoverflow.com/questions/52337355/nswag-filter-namespace](https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-nswag)
110
+
*[Get started with Swashbuckle and ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle)
0 commit comments