Yarkool.SwaggerUI
0.0.11
dotnet add package Yarkool.SwaggerUI --version 0.0.11
NuGet\Install-Package Yarkool.SwaggerUI -Version 0.0.11
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Yarkool.SwaggerUI" Version="0.0.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Yarkool.SwaggerUI --version 0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yarkool.SwaggerUI, 0.0.11"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Yarkool.SwaggerUI as a Cake Addin #addin nuget:?package=Yarkool.SwaggerUI&version=0.0.11 // Install Yarkool.SwaggerUI as a Cake Tool #tool nuget:?package=Yarkool.SwaggerUI&version=0.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Yarkool.SwaggerUI
//Add swagger
builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "API V1", Version = "v1" });
options.AddServer(new OpenApiServer()
{
Url = "",
Description = "Description"
});
options.CustomOperationIds(apiDesc =>
{
var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
return controllerAction!.ControllerName + "-" + controllerAction.ActionName;
});
foreach (var file in Directory.GetFiles(AppContext.BaseDirectory, "*.xml"))
{
options.IncludeXmlComments(file);
}
var securityScheme = new OpenApiSecurityScheme
{
Description = "Format: Bearer {access_token}",
Name = "Authorization",
In = ParameterLocation.Header,
Scheme = "Bearer",
Type = SecuritySchemeType.ApiKey
};
options.AddSecurityDefinition("Bearer", securityScheme);
options.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Id = "Bearer", //The name of the previously defined security scheme.
Type = ReferenceType.SecurityScheme
}
},
Array.Empty<string>()
}
});
});
app.UseYarkoolSwaggerUI(c =>
{
c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
});
app.UseRouting().UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Swashbuckle.AspNetCore (>= 6.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.11 | 82 | 11/15/2024 |