/// <summary>
        /// Configure SwaggerUIOptions with client id.
        /// </summary>
        /// <param name="swaggerUIOptions">the SwaggerUIOptions instance to extend.</param>
        /// <param name="clientId">The ClientId for oauth2 endpoint.</param>
        public static void ConfigureOauth2Authentication(this SwaggerUIOptions swaggerUIOptions, string clientId)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }

            swaggerUIOptions.OAuthClientId(clientId);
            swaggerUIOptions.OAuthRealm(clientId);
            swaggerUIOptions.OAuthScopeSeparator(" ");
        }
        public static void SetupSwaggerUIOptions(this SwaggerUIOptions options)
        {
            options.DocumentTitle = "ProjectName BoundedContext Api V1 Docs";
            options.RoutePrefix   = "docs";
            options.SwaggerEndpoint("/docs/v1/json", "ProjectName BoundedContext Api V1 Docs");
            options.SwaggerEndpoint("/docs/admin-v1/json", "ProjectName BoundedContext Admin Api V1 Docs");
            options.IndexStream = () => Assembly.GetExecutingAssembly()
                                  .GetManifestResourceStream("BoundedContext.Api.Swagger.CustomUI.index.html");

            options.OAuthClientId("resourceowner");
            options.OAuthClientSecret("TPOAuthClientSecret");
            options.OAuthRealm("realm");
            options.OAuthAppName("BoundedContext");
        }