File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 <PackageReference Include =" Serilog.Settings.Configuration" />
8383 <PackageReference Include =" Serilog.Sinks.Console" />
8484 <PackageReference Include =" Serilog.Sinks.File" />
85- <PackageReference Include =" Swashbuckle.AspNetCore" />
86- <PackageReference Include =" Swashbuckle.AspNetCore.Swagger" />
87- <PackageReference Include =" Swashbuckle.AspNetCore.SwaggerGen" />
88- <PackageReference Include =" Swashbuckle.AspNetCore.SwaggerUI" />
85+ <PackageReference Include =" Scalar.AspNetCore" />
8986 <PackageReference Include =" SystemExtensions.NetStandard.Generators" PrivateAssets =" all" />
9087 <PackageReference Include =" ZLinq" />
9188 </ItemGroup >
Original file line number Diff line number Diff line change @@ -87,8 +87,6 @@ private static WebApplication CreateApplication(int port)
8787 . WithRoutes ( )
8888 . WithHealthChecks ( ) ;
8989
90- builder . Services . AddOpenApi ( ) ;
91-
9290 // Add CORS policy - allow localhost and trusted community sites
9391 builder . Services . AddCors ( options =>
9492 {
Original file line number Diff line number Diff line change 1- using Microsoft . AspNetCore . Http . Json ;
2- using Microsoft . AspNetCore . Routing . Constraints ;
3- using Microsoft . Extensions . Options ;
4- using Swashbuckle . AspNetCore . SwaggerGen ;
5- using System . Text . Json ;
1+ using Microsoft . AspNetCore . Routing . Constraints ;
62
73namespace Daybreak . API . Swagger ;
84
@@ -11,14 +7,6 @@ public static class WebApplicationBuilderExtensions
117 public static WebApplicationBuilder WithSwagger ( this WebApplicationBuilder builder )
128 {
139 builder . Services . AddEndpointsApiExplorer ( ) ;
14- builder . Services . AddSwaggerGen ( ) ;
15- builder . Services . AddTransient < ISerializerDataContractResolver > ( sp =>
16- {
17- var opts = sp . GetRequiredService < IOptions < JsonOptions > > ( ) . Value ? . SerializerOptions
18- ?? new JsonSerializerOptions ( JsonSerializerDefaults . Web ) ;
19-
20- return new JsonSerializerDataContractResolver ( opts ) ;
21- } ) ;
2210 builder . Services . Configure < RouteOptions > ( static options =>
2311 {
2412 options . SetParameterPolicy < RegexInlineRouteConstraint > ( "regex" ) ;
Original file line number Diff line number Diff line change 1- namespace Daybreak . API . Swagger ;
1+ using Scalar . AspNetCore ;
2+
3+ namespace Daybreak . API . Swagger ;
24
35public static class WebApplicationExtensions
46{
57 public static WebApplication UseSwaggerWithUI ( this WebApplication app )
68 {
7- app . UseSwagger ( ) ;
8- app . UseSwaggerUI ( ) ;
9+ app . MapOpenApi ( ) ;
10+ app . MapScalarApiReference ( ) ;
911 return app ;
1012 }
1113}
Original file line number Diff line number Diff line change 5555 <PackageVersion Include =" SevenZipExtractor" Version =" 1.0.19" />
5656 <PackageVersion Include =" SharpCompress" Version =" 0.47.4" />
5757 <PackageVersion Include =" SixLabors.ImageSharp" Version =" 3.1.12" />
58- <PackageVersion Include =" Swashbuckle.AspNetCore" Version =" 10.1.7" />
59- <PackageVersion Include =" Swashbuckle.AspNetCore.Swagger" Version =" 10.1.7" />
60- <PackageVersion Include =" Swashbuckle.AspNetCore.SwaggerGen" Version =" 10.1.7" />
61- <PackageVersion Include =" Swashbuckle.AspNetCore.SwaggerUI" Version =" 10.1.7" />
58+ <PackageVersion Include =" Scalar.AspNetCore" Version =" 2.14.1" />
6259 <PackageVersion Include =" Sybil" Version =" 0.8.4" />
6360 <PackageVersion Include =" System.IO.Compression" Version =" 4.3.0" />
6461 <PackageVersion Include =" System.Diagnostics.PerformanceCounter" Version =" 10.0.6" />
You can’t perform that action at this time.
0 commit comments