-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
'OpenApiDocument' does not contain a definition for 'BasePath' and no accessible extension method 'BasePath' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)
This should work for doc.BasePath
.
app.UseSwagger(c =>
{
if (info.RouteTemplate != null)
c.RouteTemplate = info.RouteTemplate;
c.PreSerializeFilters.Add((doc, req) =>
{
doc.BasePath = info.BasePath ?? "/" + serviceName;
});
});
https://swagger.io/docs/specification/2-0/api-host-and-base-path/
Metadata
Metadata
Assignees
Labels
No labels