/// <summary> /// realm query parameter (for oauth1) added to authorizationUrl and tokenUrl /// </summary> /// <param name="options"></param> /// <param name="value"></param> public static void OAuthRealm(this SwaggerUIOptions options, string value) { options.OAuthConfigObject.Realm = value; }
/// <summary> /// Application name, displayed in authorization popup /// </summary> /// <param name="options"></param> /// <param name="value"></param> public static void OAuthAppName(this SwaggerUIOptions options, string value) { options.OAuthConfigObject.AppName = value; }
/// <summary> /// You can use this parameter to enable the swagger-ui's built-in validator (badge) functionality /// Setting it to null will disable validation /// </summary> /// <param name="options"></param> /// <param name="url"></param> public static void EnableValidator(this SwaggerUIOptions options, string url = "https://online.swagger.io/validator") { options.ConfigObject.ValidatorUrl = url; }
/// <summary> /// Default clientSecret /// </summary> /// <param name="options"></param> /// <param name="value"></param> public static void OAuthClientSecret(this SwaggerUIOptions options, string value) { options.OAuthConfigObject.ClientSecret = value; }
/// <summary> /// The default expansion depth for the model on the model-example section /// </summary> /// <param name="options"></param> /// <param name="depth"></param> public static void DefaultModelExpandDepth(this SwaggerUIOptions options, int depth) { options.ConfigObject.DefaultModelExpandDepth = depth; }
public static void ValidatorUrl(this SwaggerUIOptions options, string url) { options.ConfigObject.ValidatorUrl = url; }
/// <summary> /// Controls the display of vendor extension (x-) fields and values for Operations, Parameters, and Schema /// </summary> /// <param name="options"></param> public static void ShowExtensions(this SwaggerUIOptions options) { options.ConfigObject.ShowExtensions = true; }
/// <summary> /// Only activated for the accessCode flow. During the authorization_code request to the tokenUrl, /// pass the Client Password using the HTTP Basic Authentication scheme (Authorization header with /// Basic base64encoded[client_id:client_secret]). The default is false /// </summary> /// <param name="options"></param> public static void OAuthUseBasicAuthenticationWithAccessCodeGrant(this SwaggerUIOptions options) { options.OAuthConfigObject.UseBasicAuthenticationWithAccessCodeGrant = true; }
/// <summary> /// Enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. /// If an expression is provided it will be used and applied initially. /// Filtering is case sensitive matching the filter expression anywhere inside the tag /// </summary> /// <param name="options"></param> /// <param name="expression"></param> public static void EnableFilter(this SwaggerUIOptions options, string expression = null) { options.ConfigObject.Filter = expression ?? ""; }
/// <summary> /// Limits the number of tagged operations displayed to at most this many. The default is to show all operations /// </summary> /// <param name="options"></param> /// <param name="count"></param> public static void MaxDisplayedTags(this SwaggerUIOptions options, int count) { options.ConfigObject.MaxDisplayedTags = count; }
/// <summary> /// Controls the default expansion setting for the operations and tags. /// It can be 'List' (expands only the tags), 'Full' (expands the tags and operations) or 'None' (expands nothing) /// </summary> /// <param name="options"></param> /// <param name="docExpansion"></param> public static void DocExpansion(this SwaggerUIOptions options, DocExpansion docExpansion) { options.ConfigObject.DocExpansion = docExpansion; }
/// <summary> /// Controls the display of the request duration (in milliseconds) for Try-It-Out requests /// </summary> /// <param name="options"></param> public static void DisplayRequestDuration(this SwaggerUIOptions options) { options.ConfigObject.DisplayRequestDuration = true; }
/// <summary> /// Controls how the model is shown when the API is first rendered. /// (The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links.) /// </summary> /// <param name="options"></param> /// <param name="modelRendering"></param> public static void DefaultModelRendering(this SwaggerUIOptions options, ModelRendering modelRendering) { options.ConfigObject.DefaultModelRendering = modelRendering; }
/// <summary> /// Scope separator for passing scopes, encoded before calling, default value is a space (encoded value %20) /// </summary> /// <param name="options"></param> /// <param name="value"></param> public static void OAuthScopeSeparator(this SwaggerUIOptions options, string value) { options.OAuthConfigObject.ScopeSeperator = value; }
/// <summary> /// List of HTTP methods that have the Try it out feature enabled. An empty array disables Try it out for all operations. /// This does not filter the operations from the display /// </summary> /// <param name="options"></param> /// <param name="submitMethods"></param> public static void SupportedSubmitMethods(this SwaggerUIOptions options, params SubmitMethod[] submitMethods) { options.ConfigObject.SupportedSubmitMethods = submitMethods; }
/// <summary> /// Additional query parameters added to authorizationUrl and tokenUrl /// </summary> /// <param name="options"></param> /// <param name="value"></param> public static void OAuthAdditionalQueryStringParams( this SwaggerUIOptions options, Dictionary <string, string> value) { options.OAuthConfigObject.AdditionalQueryStringParams = value; }
/// <summary> /// OAuth redirect URL /// </summary> /// <param name="options"></param> /// <param name="url"></param> public static void OAuth2RedirectUrl(this SwaggerUIOptions options, string url) { options.ConfigObject.OAuth2RedirectUrl = url; }
/// <summary> /// Enables deep linking for tags and operations /// </summary> /// <param name="options"></param> public static void EnableDeepLinking(this SwaggerUIOptions options) { options.ConfigObject.DeepLinking = true; }
/// <summary> /// Controls the display of operationId in operations list /// </summary> /// <param name="options"></param> public static void DisplayOperationId(this SwaggerUIOptions options) { options.ConfigObject.DisplayOperationId = true; }