Skip to content

Commit

Permalink
Move config to appsettings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarciarubio committed Nov 6, 2024
1 parent 773501b commit b700bf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions AspNetCore.Examples.Auth.Api/Extensions/OpenApiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ public static WebApplication UseCustomOpenApi(this WebApplication app, IConfigur
var swaggerUIConfig = configuration.GetSection("OpenApi:SwaggerUI");
if (swaggerUIConfig.Exists())
{
app.UseSwaggerUI(config =>
{
config.ConfigObject.Urls = [new() { Name = "V1", Url = "/openapi/v1.json" }];
swaggerUIConfig.Bind(config);
});
app.UseSwaggerUI(swaggerUIConfig.Bind);
}

var scalarConfig = configuration.GetSection("OpenApi:Scalar");
Expand Down
8 changes: 8 additions & 0 deletions AspNetCore.Examples.Auth.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
},
"OpenApi": {
"SwaggerUI": {
"ConfigObject": {
"Urls": [
{
"Name": "V1",
"Url": "/openapi/v1.json"
}
]
},
"OAuthConfigObject": {
"ClientId": "interactive.public",
"ScopeSeparator": " ",
Expand Down

0 comments on commit b700bf1

Please sign in to comment.