Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TransformToExternalPath setting #1728

Merged
merged 15 commits into from
Nov 12, 2018
Merged

Conversation

RicoSuter
Copy link
Owner

@RicoSuter RicoSuter commented Nov 9, 2018

  • Add TransformToExternalPath setting

Transform the internal route to an external route based on the request headers from nginx:

app.UseSwaggerUi3(config => config.TransformToExternalPath = (internalUiRoute, request) => 
{ 
    // The header X-External-Path is set in the nginx.conf file 
    var externalPath = request.Headers.ContainsKey("X-External-Path") ? request.Headers["X-External-Path"].First() : "";  
    return externalPath + internalUiRoute; 
}); 

Breaking changes:

  • Rename SwaggerRoute/SwaggerUiRoute to DocumentPath/Path

@RicoSuter RicoSuter merged commit 088a2b7 into master Nov 12, 2018
@RicoSuter RicoSuter mentioned this pull request Nov 15, 2018
5 tasks
@RicoSuter RicoSuter deleted the features/add-nginx-sample branch December 19, 2018 15:48
@TwoAngel
Copy link

TwoAngel commented Sep 5, 2019

Soo, u removed "UseSwaggerUi3WithApiExplorer" and instead??

@RicoSuter
Copy link
Owner Author

AddSwaggerDocument()
UseOpenApi()
UseSwaggerUi3()

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.

2 participants