It's possible to use Url.Content and scripts in DummyPage.razor? It's necessary to implement the code from DummyPage.cshtml to DummyPage.razor.
@page "/apidocumentation"
<div class="container-flex">
<div class="col-lg-12 control-section">
<div class="content-wrapper">
<div class="row">
<rapi-doc spec-url="@Url.Content("doc/api/dummy.json")"></rapi-doc>
<section Scripts>
<script src="@Url.Content("lib/rapidoc/dummy.js")"></script>
</section>
</div>
</div>
</div>
</div>
@code {
}
You need inject IJSRuntime for JS. It allows to load JavaScript code to your component.
If your JS function has a specific name, you can call with these function: InvokeAsync/InvokeVoidAsync.
Example:
Add script tag in your _Host.cshtml
(P.S. ~ is equal to your wwwroot folder)
...
<script src="~/js/myJS.js"></script>
<script src="_framework/blazor.server.js"></script>
myJS.js
function MyScript(name) {
return "Hello " + name;
}
Test.razor
@page "/test"
@inject IJSRuntime JS
<p id="myId">@Text</p>
<button @onclick="OnClick">Submit</button>
@code {
private string Text { get; set; }
private async void OnClick()
{
var exampleText = "World!";
try
{
Text = await JS.InvokeAsync<string>("MyScript", exampleText);
}
catch(JSException ex)
{
Text = ex.Message;
}
StateHasChanged();
}
}
Example after pushed the button:

If your JS script use a function onload (for example), you could override and use the OnAfterRenderAsync function.
protected override async Task OnAfterRenderAsync(bool firstRender)
{
//invoke only one time, after your component is loaded
if (firstRender)
{
await JS.InvokeVoidAsync("onload");
}
}
I don't know rapi-doc, maybe you could pass the json through backend with a variable.