This commit is contained in:
JustArchi
2018-11-28 04:18:44 +01:00
parent f0c15a0eec
commit c4e6d34b85

View File

@@ -74,7 +74,7 @@ namespace ArchiSteamFarm.IPC {
app.UseSwagger(); app.UseSwagger();
// Use friendly swagger UI // Use friendly swagger UI
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/ASF/swagger.json", "ASF API")); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/" + SharedInfo.ASF + "/swagger.json", SharedInfo.ASF + " API"));
// We're using index for URL routing in our static files so re-execute all non-API calls on / // We're using index for URL routing in our static files so re-execute all non-API calls on /
app.UseWhen(context => !context.Request.Path.StartsWithSegments("/Api", StringComparison.OrdinalIgnoreCase), appBuilder => appBuilder.UseStatusCodePagesWithReExecute("/")); app.UseWhen(context => !context.Request.Path.StartsWithSegments("/Api", StringComparison.OrdinalIgnoreCase), appBuilder => appBuilder.UseStatusCodePagesWithReExecute("/"));
@@ -114,7 +114,10 @@ namespace ArchiSteamFarm.IPC {
new OpenApiSecurityRequirement { new OpenApiSecurityRequirement {
{ {
new OpenApiSecurityScheme { new OpenApiSecurityScheme {
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = nameof(GlobalConfig.IPCPassword) } Reference = new OpenApiReference {
Id = nameof(GlobalConfig.IPCPassword),
Type = ReferenceType.SecurityScheme
}
}, },
new string[0] new string[0]
@@ -125,7 +128,7 @@ namespace ArchiSteamFarm.IPC {
c.DescribeAllEnumsAsStrings(); c.DescribeAllEnumsAsStrings();
c.EnableAnnotations(); c.EnableAnnotations();
c.SwaggerDoc( c.SwaggerDoc(
"ASF", new OpenApiInfo { SharedInfo.ASF, new OpenApiInfo {
Contact = new OpenApiContact { Contact = new OpenApiContact {
Name = SharedInfo.GithubRepo, Name = SharedInfo.GithubRepo,
Url = new Uri(SharedInfo.ProjectURL) Url = new Uri(SharedInfo.ProjectURL)
@@ -136,7 +139,7 @@ namespace ArchiSteamFarm.IPC {
Url = new Uri(SharedInfo.LicenseURL) Url = new Uri(SharedInfo.LicenseURL)
}, },
Title = "ASF API" Title = SharedInfo.ASF + " API"
} }
); );