Altemiq.AspNetCore.OpenApi 9.0.8

dotnet add package Altemiq.AspNetCore.OpenApi --version 9.0.8
                    
NuGet\Install-Package Altemiq.AspNetCore.OpenApi -Version 9.0.8
                    
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="Altemiq.AspNetCore.OpenApi" Version="9.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Altemiq.AspNetCore.OpenApi" Version="9.0.8" />
                    
Directory.Packages.props
<PackageReference Include="Altemiq.AspNetCore.OpenApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Altemiq.AspNetCore.OpenApi --version 9.0.8
                    
#r "nuget: Altemiq.AspNetCore.OpenApi, 9.0.8"
                    
#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.
#:package Altemiq.AspNetCore.OpenApi@9.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Altemiq.AspNetCore.OpenApi&version=9.0.8
                    
Install as a Cake Addin
#tool nuget:?package=Altemiq.AspNetCore.OpenApi&version=9.0.8
                    
Install as a Cake Tool

Altemiq.AspNetCore.OpenApi

This contains methods to extend Microsoft.AspNetCore.OpenApi with extra functionality

OpenApi

SetInfo

This sets the information for the document

services.AddOpenApi(options => options.SetInfo("API Title"));

results in

"info": {
    "title": "API Title | v1",
    "version": "1.0.0.0"
}

UsePathBase

This sets the path base for the service section

services.AddOpenApi(options => options.UsePathBase("/api"));

results in

"servers": [
    {
        "url": "/api"
    }
]

Add* (SecurityScheme)

This adds and returns the added security scheme

AddApiKey
services.AddOpenApi(options => options.AddApiKey());
AddHttp
services.AddOpenApi(options => options.AddHttp());
AddOAuth2
services.AddOpenApi(options => 
{
    var scheme = options.AddOAuth2(
        new Microsoft.OpenApi.Models.OpenApiOAuthFlows
        {
            Password = new Microsoft.OpenApi.Models.OpenApiOAuthFlow
            {
                Scopes =
                {
                    ["first"] = "First Scope",
                    ["second"] = "Second Scope",
                    ["third"] = "Third Scope",
                    ["forth"] = "Forth Scope",
                },
            },
        });
});
AddOpenIdConnect
services.AddOpenApi(options => options.AddOpenIdConnect("http://auth.local.dev/.well-known/openid-configuration"));

WithAuthorizeCheck

This adds a check to see if the end point has any IAuthorizeData metadata, and if so, adds the standard responses. This also adds the specified security scheme to the end point, and also configures the requirements for the scheme.

services.AddOpenApi(options => options.WithAuthorizeCheck(securityScheme));

This takes into account the scopes specified if the scheme is either OAuth2 or OpenIdConnect

HTTP

This extends IEndpointConventionBuilder to include extra metadata

WithScopes / ScopesAttribute

Adds scopes to the authorization.

app
    .MapGet("requires-scopes", () => "Requires Scopes")
    .RequireAuthorization()
    .WithScopes("first", "second");
[ApiController]
[Route("controllers/[controller]")]
public class WeatherForecastController : ControllerBase
{
    [HttpGet(Name = "GetWeatherForecast")]
    [Microsoft.AspNetCore.Authorization.Authorize]
    [Scopes("third", "forth")]
    public IEnumerable<WeatherForecast> Get() => WeatherForecast.Get();
}

This will only be taken into account if the end point requires authorization.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
9.0.8 151 8/20/2025
9.0.7 215 7/9/2025
9.0.6 140 7/9/2025
9.0.5 137 7/9/2025
9.0.4 141 7/9/2025
9.0.3 135 7/9/2025
9.0.2 140 7/9/2025
9.0.1 139 7/9/2025
9.0.0 135 7/9/2025