Skip to content

Commit 0c28190

Browse files
committed
Remove Swagger UI - can be added with x mix openapi3
1 parent ec5c6c3 commit 0c28190

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

MyApp/MyApp.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.*" />
16-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.*" />
1715
<PackageReference Include="ServiceStack" Version="8.*" />
1816
<PackageReference Include="ServiceStack.Extensions" Version="8.*" />
19-
<PackageReference Include="ServiceStack.AspNetCore.OpenApi" Version="8.*" />
2017
</ItemGroup>
21-
18+
2219
<ItemGroup>
2320
<ProjectReference Include="..\MyApp.ServiceInterface\MyApp.ServiceInterface.csproj" />
2421
<ProjectReference Include="..\MyApp.ServiceModel\MyApp.ServiceModel.csproj" />

MyApp/Program.cs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
using MyApp.ServiceInterface;
2-
3-
var builder = WebApplication.CreateBuilder(args);
1+
var builder = WebApplication.CreateBuilder(args);
42
var services = builder.Services;
53

6-
services.AddServiceStack(typeof(MyServices).Assembly, c =>
7-
{
8-
c.AddSwagger();
9-
});
10-
11-
services.AddEndpointsApiExplorer();
12-
services.AddSwaggerGen();
13-
144
var app = builder.Build();
155

166
// Configure the HTTP request pipeline.
17-
if (app.Environment.IsDevelopment())
18-
{
19-
app.UseSwagger();
20-
app.UseSwaggerUI();
21-
}
22-
else
7+
if (!app.Environment.IsDevelopment())
238
{
249
app.UseExceptionHandler("/Error", createScopeForErrors: true);
2510
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.

MyApp/wwwroot/index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ <h2 class="text-4xl my-4 text-center"><a href="/ui/Hello" class="font-semibold t
9090
- [View API Details](/ui/Hello?tab=details)
9191
- [Browse API source code in different languages](/ui/Hello?tab=code)
9292

93-
## View in Swagger UI
94-
- [Swagger UI](/swagger/index.html)
95-
- [Open API v3 JSON](/swagger/v1/swagger.json)
96-
9793
### Tailwind Configuration
9894

9995
This empty web template is configured with a stand-alone [Tailwind CSS CLI](https://tailwindcss.com/docs/installation)

0 commit comments

Comments
 (0)