Unable to inject javascript into Swagger documentation

Viewed 202

So I've seen this question posed before, but I feel like I have a specific context that warrants posing the question. I could be risking getting a good ol' stack overflow scolding, but here goes. In either case, I feel like it's going to likely be a one-line fix, so I'm prepared to be humbled. Quick profile of the system:

AspNetCore: 2.2.0
Swashbuckle: 4.0.1
Filename: ./SwaggerExtensions/test.js (only trying to get a console log verification at this point)

Inside Configure Method

app.UseSwaggerUI(o =>
        {
            o.SwaggerEndpoint($"/docs/swagger.json", $"{ApplicationName} {_applicationVersion}");

            o.InjectJavascript("identity.SwaggerExtensions.test.js");
        });

Additionally, I have invoked the UseStaticFiles middleware at the top of the Configure method. I have seen other implementations that require the use of the specific assembly (e.g. SwaggerConfig), but the version I'm using only calls for the 'logical name' of the file path (appName.directory.filename.type), but the InjectJavascript method for the version I'm using has no parameter for the assembly, only the file and an optional parameter for the type (e.g., text/javascript):

enter image description here

I feel like I've followed other posts about this pretty closely and I can't seem to make any headway on what appears to be a pretty straightforward implementation.

enter image description here

Additionally, the js file is being appended to the head of the html, but I imagine the format should be converted to a regular path. I have also set the Build Action to Embedded Resource. I feel like I've been chasing my tail for the last day or so trying to get this working so I can move on to implementing an auth flow.

0 Answers
Related