private static void SetupDescription(OpenApiSecurityScheme securityScheme, string tokenUrl) { var securityDocs = NSwagHelper.LoadDocs("security"); var securityText = securityDocs.Replace("<TOKEN_URL>", tokenUrl); securityScheme.Description = securityText; }
private static SwaggerSecurityScheme CreateOAuthSchema(UrlsOptions urlOptions) { var securityScheme = new SwaggerSecurityScheme(); var tokenUrl = urlOptions.BuildUrl($"{Constants.IdentityServerPrefix}/connect/token", false); securityScheme.TokenUrl = tokenUrl; var securityDocs = NSwagHelper.LoadDocs("security"); var securityText = securityDocs.Replace("<TOKEN_URL>", tokenUrl); securityScheme.Description = securityText; securityScheme.Type = SwaggerSecuritySchemeType.OAuth2; securityScheme.Flow = SwaggerOAuth2Flow.Application; securityScheme.Scopes = new Dictionary <string, string> { [Constants.ApiScope] = "Read and write access to the API" }; return(securityScheme); }
static SchemaSwaggerGenerator() { SchemaBodyDescription = NSwagHelper.LoadDocs("schemabody"); SchemaQueryDescription = NSwagHelper.LoadDocs("schemaquery"); }