When using APIExplorer the ControllerType is incorrect and version appears incomplete
See original GitHub issueAfter #1288 was completed I was able to test NSwag with and without API Explorer, and I found a few differences. So, my controller is inheriting from another controller, and that is what #1288 fixed. But the name that shows up is the name of the controller that has the original operation, not from the one that inherited it.
Also, the version appears as “v1.0” without API Explorer, but only as “v1” with API Explorer. I am not sure why.
Bellow you can see both without API Explorer (1st image) and with (2nd image):
Also, to only show v1 and v2 on specific pages, I add NSwag several times, one for each version (with different routes), and then I am doing this:
if (!string.IsNullOrWhiteSpace(version))
generatorSettings.OperationProcessors.OfType<ApiVersionProcessor>().Single().IncludedVersions.Add(version);
(I am not sure this is the expected way to do it… anyway)
But, as the versions are showing up differently (v1.0 vs v1), all operations are shown, as you can see on the second image. I am sure that this is happening because of this line, which returns null: https://github.com/RSuter/NSwag/blob/c44d37206e65b7271cad4c7180c5e6724e65c449/src/NSwag.SwaggerGeneration/Processors/ApiVersionProcessor.cs#L47
So, there are these 2 differences from using API Explorer or not.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
After updating to version 12 everything is working as expected. Also, the code is overall much simpler. The new version is cool! Thanks!
Hi, just coming back here to report the status after testing it with version
11.20.1
. I am getting the same results.