Open rajarathinam93 opened 1 month ago
Hey, you can use the aspnetcore2openapi
command instead.
@xC0dex I tried that, it seems to be working, but not finding any api's.
Like i mentioned i have all my endpoints under core api project and that is not having any webhost, its a simple class library.
I am serving those api's through main WebApp.
Looks like after building Main webapp aspnetcore2openapi unable to find any api's. or am i missing something?
Also, When i tried aspnetcore2openapi command on core api project, its complaining for no webhost exists.
@xC0dex/others - Any input on my above query.
Hey @rajarathinam93, I think NSwag uses the ApiEndpointExplorer to get all the required information for building the OpenApi document. Does the Swagger UI contain all endpoints when you run the application when you run the WebApp
? I guess you have to run the Nswag tool on the executable (In your case WebApp
)
@xC0dex - Thanks for the response.
NSwag does not generate endpoints on the executables of WebApp
either.
Swagger UI of WebApp
also not showing any of the endpoints.
var webApiAssembly = typeof(ApiControllerBase).Assembly; var mvcBuilder = services.AddMvc().AddApplicationPart(webApiAssembly);
This is how webapi project assemblies has been added into main WebApp
Hi, I am migrating my app from .net 6.0 to .net 8.0. I have a web api project in my solution which i am serving through orchestrator WebApp. In the After-build event i was generating open api specification using NSwag webapi2openapi from the webapi assembly.
Now i see it's not supported anymore.
Can anyone help me with suitable solution or alternates.
Thanks!