Skip to content

Add AbpAppPath extension method and update appPath handling in Swagger UI scripts#24799

Merged
EngincanV merged 2 commits intorel-10.1from
SwaggerAbpAppPath
Feb 4, 2026
Merged

Add AbpAppPath extension method and update appPath handling in Swagger UI scripts#24799
EngincanV merged 2 commits intorel-10.1from
SwaggerAbpAppPath

Conversation

@maliming
Copy link
Member

@maliming maliming commented Feb 4, 2026

Resolves #24798

app.UseAbpSwaggerUI(options =>
{
    options.AbpAppPath("/mysubapp/");
    options.SwaggerEndpoint("/mysubapp/swagger/v1/swagger.json", "Test MyProjectName API");
});

https://abp.io/support/questions/10387/We-need-a-meeting-to-take-sample-abp-mvc-layered-project-using-pathbased-routing#answer-3a1f36ce-f635-d283-5b95-a16e8d3e907b

Copilot AI review requested due to automatic review settings February 4, 2026 03:49
@maliming maliming added this to the 10.1-final milestone Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #24798 by introducing an explicit AbpAppPath extension method for configuring the application base path in Swagger UI, replacing the previous automatic detection mechanism based on HTML <base> elements.

Changes:

  • Adds new AbpAppPath() extension method to explicitly set the application base path for Swagger UI
  • Removes automatic <base> element detection from JavaScript initialization in favor of explicit configuration
  • Simplifies JavaScript fallback logic to default to "/" when not explicitly configured

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
AbpSwaggerUIOptionsExtensions.cs New extension method that injects a script setting abp.appPath into Swagger UI's HeadContent with proper path normalization
abp.js Removes automatic base element detection, simplifies to use explicit abp.appPath or default to "/"
abp.swagger.js Removes reference to configObject.baseUrl, relies on abp.appPath set elsewhere

@maliming maliming requested a review from EngincanV February 4, 2026 05:58
@EngincanV EngincanV merged commit 225fc98 into rel-10.1 Feb 4, 2026
3 checks passed
@EngincanV EngincanV deleted the SwaggerAbpAppPath branch February 4, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants