TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rafael Cruz
NA
23
0
Swagger not working when is deployed
May 17 2021 7:32 PM
I need some help, there is a .net core 3.1 project that includes swagger, swagger UI works in local but when is deployed.
ConfigureServices method
// Register the Swagger generator, defining one or more Swagger documents
services.AddSwaggerGen(c =>
{
c.SwaggerDoc(
"v1"
,
new
OpenApiInfo
{
Title =
"my app V1"
,
Version =
"v1"
});
c.ExampleFilters();
c.OperationFilter();
// Set the comments path for the Swagger JSON and UI.
var
xmlFile = $
"{Assembly.GetExecutingAssembly().GetName().Name}.xml"
;
var
xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath);
});
services.ConfigureSwaggerGen(options =>
{
options.CustomSchemaIds(x => x.FullName);
});
services.AddSwaggerExamplesFromAssemblies();
Configure Method
app.UseSwaggerUI(c =>
{
c.RoutePrefix =
"swagger"
;
c.SwaggerEndpoint(
"./v1/swagger.json"
,
"my app V1"
);
c.DefaultModelsExpandDepth(-1);
});
Reply
Answers (
2
)
i want to get only one column in sql web api
server.MapPath in c# mvc