-
Notifications
You must be signed in to change notification settings - Fork 16
Updates Server for net9.0 OpenAPI support #1751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,7 +23,8 @@ | |||||||||||
| <!--#if (useSerilog)--> | ||||||||||||
| <PackageReference Include="Serilog.AspNetCore" /> | ||||||||||||
| <!--#endif--> | ||||||||||||
| <PackageReference Include="Swashbuckle.AspNetCore" /> | ||||||||||||
| <PackageReference Include="Scalar.AspNetCore" /> | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
And in the either way Uno Solution Items Provided |
||||||||||||
| <PackageReference Include="Microsoft.AspNetCore.OpenApi" /> | ||||||||||||
| <!--#if (useWasm)--> | ||||||||||||
| <PackageReference Include="Uno.Wasm.Bootstrap.Server" /> | ||||||||||||
| <!--#endif --> | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,27 +36,24 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| builder.Services.Configure<RouteOptions>(options => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options.LowercaseUrls = true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| builder.Services.AddEndpointsApiExplorer(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| builder.Services.AddSwaggerGen(c => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Include XML comments for all included assemblies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Directory.EnumerateFiles(AppContext.BaseDirectory, "*.xml") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .Where(x => x.Contains("MyExtensionsApp._1") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| && File.Exists(Path.Combine( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AppContext.BaseDirectory, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $"{Path.GetFileNameWithoutExtension(x)}.dll"))) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .ToList() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .ForEach(path => c.IncludeXmlComments(path)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| builder.Services.AddOpenApi(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var app = builder.Build(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Configure the HTTP request pipeline. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (app.Environment.IsDevelopment()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.UseSwagger(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.UseSwaggerUI(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.MapOpenApi(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.MapScalarApiReference(o => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| o.EnabledClients = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ScalarClient.HttpClient, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ScalarClient.Http11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ScalarClient.JQuery, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ScalarClient.Xhr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.UseHttpsRedirection(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.