FileUpload
SecurityApiKey
DefaultValue
Model
Property
services.AddSwaggerGen(options => {
// ...
options.EnableAnnotations();
options.AddSecurityDefinition("secret", new OpenApiSecurityScheme { // demo
Type = SecuritySchemeType.ApiKey,
In = ParameterLocation.Header,
Name = "Authorization"
});
options.EnableAoiHosizoraSwaggerAnnotations();
});
// demo for SecurityApiKey
[HttpGet("test")]
[SwaggerSecurityApiKey("secret")]
// [Authorize]
public IActionResult Test() { }
# Package manager
Install-Package AoiHosizora.Swagger -Version 1.0.3
# .NET CLI
dotnet add package AoiHosizora.Swagger --version 1.0.3