services.AddSwaggerGen(x =>
{
});
I have explored the AddSwaggerGen()
method of NuGet Swashbuckle.AspNetCore
. Unfortunately, I haven't found a way to use the path
of the already generated open API specification file.
My APIs are related to file upload in .net core and I have already written the swagger specification file swagger.yaml
and It is working fine with editor.swagger.io. Can anyone help me? How can I inject the generated open API specification file and use it with SwaggerUI in .net core with NuGet Swashbuckle.AspNetCore
?
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/swagger.yaml", "My API V1");
});
I have created a static file /swagger/swagger.yaml
in my project But Swagger UI still using the same file which is generated by internally.