This PR is motivated by a need for supporting Auth0's additional requirements when generating access tokens. An additional parameter must be sent in the token request.
I chose to follow the same replacement strategy as the custom CSS and custom Javascript. I added 2 methods to the IOpenApiCustomUIOptions interface and implemented them as empty strings in the default implementation.
The downside to this method is that it is a breaking change for any downstream implementations of IOpenApiCustomUIOptions.
I also considered a solution of adding a new options class and passing it to the ISwaggerUI.BuildAsync method. However, this would have represented a breaking change to the ISwaggerUI interface. This solution would have also required a new default implementation, a new resolver, an update to the IOpenApiHttpTriggerContext interface and OpenApiHttpTriggerContext class.
The additional spread of the change required for the second solution seemed to be more complicated than updating the IOpenApiCustomUIOptions interface.
This PR is motivated by a need for supporting Auth0's additional requirements when generating access tokens. An additional parameter must be sent in the token request.
The SwaggerUI object allows passing in functions that intercept the request and response objects. The Swashbuckle.AspNetCore.Swagger project allows access to these functions via a builder extension method (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/8f363f7359cb1cb8fa5de5195ec6d97aefaa16b3/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs#L321C4-L321C4).
I chose to follow the same replacement strategy as the custom CSS and custom Javascript. I added 2 methods to the
IOpenApiCustomUIOptions
interface and implemented them as empty strings in the default implementation.The downside to this method is that it is a breaking change for any downstream implementations of
IOpenApiCustomUIOptions
.I also considered a solution of adding a new options class and passing it to the
ISwaggerUI.BuildAsync
method. However, this would have represented a breaking change to theISwaggerUI
interface. This solution would have also required a new default implementation, a new resolver, an update to theIOpenApiHttpTriggerContext
interface andOpenApiHttpTriggerContext
class.The additional spread of the change required for the second solution seemed to be more complicated than updating the
IOpenApiCustomUIOptions
interface.