Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public static IApplicationBuilder UseAbpSwaggerUI(
return app.UseSwaggerUI(options =>
{
options.InjectJavascript("ui/abp.js");
options.InjectJavascript("ui/abp.swagger.js");
options.IndexStream = () => resolver?.Resolver();

setupAction?.Invoke(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ public class SwaggerHtmlResolver : ISwaggerHtmlResolver, ITransientDependency
{
public virtual Stream Resolver()
{
var scriptBundleScript = "<script src=\"%(ScriptBundlePath)\" charset=\"utf-8\"></script>";
var abpSwaggerScript = "<script src=\"ui/abp.swagger.js\" charset=\"utf-8\"></script>";
var stream = typeof(SwaggerUIOptions).GetTypeInfo().Assembly
.GetManifestResourceStream("Swashbuckle.AspNetCore.SwaggerUI.index.html");

var html = new StreamReader(stream!)
.ReadToEnd()
.Replace("src=\"index.js\"", "src=\"ui/index.js\"");
.Replace(scriptBundleScript, $"{scriptBundleScript}\n{abpSwaggerScript}");

return new MemoryStream(Encoding.UTF8.GetBytes(html));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var abp = abp || {};

(function () {

abp.SwaggerUIBundle = function (configObject) {


var oldSwaggerUIBundle = SwaggerUIBundle;

SwaggerUIBundle = function (configObject) {
var excludeUrl = ["swagger.json", "connect/token"]
var firstRequest = true;
var oidcSupportedFlows = configObject.oidcSupportedFlows || [];
Expand Down Expand Up @@ -109,6 +110,9 @@ var abp = abp || {};
});
}

return SwaggerUIBundle(configObject);
return oldSwaggerUIBundle(configObject);
}

SwaggerUIBundle = Object.assign(SwaggerUIBundle, oldSwaggerUIBundle);

})();
75 changes: 0 additions & 75 deletions framework/src/Volo.Abp.Swashbuckle/wwwroot/swagger/ui/index.js

This file was deleted.

Loading