Add AbpAppPath extension method and update appPath handling in Swagger UI scripts#24799
Merged
Add AbpAppPath extension method and update appPath handling in Swagger UI scripts#24799
Conversation
Contributor
There was a problem hiding this comment.
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 |
...lo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerUIOptionsExtensions.cs
Outdated
Show resolved
Hide resolved
...lo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerUIOptionsExtensions.cs
Outdated
Show resolved
Hide resolved
EngincanV
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #24798
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