Soenneker.GitLab.OpenApiClientUtil
11.0.372
Prefix Reserved
dotnet add package Soenneker.GitLab.OpenApiClientUtil --version 11.0.372
NuGet\Install-Package Soenneker.GitLab.OpenApiClientUtil -Version 11.0.372
<PackageReference Include="Soenneker.GitLab.OpenApiClientUtil" Version="11.0.372" />
<PackageVersion Include="Soenneker.GitLab.OpenApiClientUtil" Version="11.0.372" />
<PackageReference Include="Soenneker.GitLab.OpenApiClientUtil" />
paket add Soenneker.GitLab.OpenApiClientUtil --version 11.0.372
#r "nuget: Soenneker.GitLab.OpenApiClientUtil, 11.0.372"
#:package Soenneker.GitLab.OpenApiClientUtil@11.0.372
#addin nuget:?package=Soenneker.GitLab.OpenApiClientUtil&version=11.0.372
#tool nuget:?package=Soenneker.GitLab.OpenApiClientUtil&version=11.0.372
Soenneker.GitLab.OpenApiClientUtil
Reuse a configured GitLabOpenApiClient throughout an application without rebuilding the Kiota adapter for each request.
Installation
dotnet add package Soenneker.GitLab.OpenApiClientUtil
Configuration
{
"GitLab": {
"ApiKey": "gitlab-token"
}
}
GitLab.com is used by default. Self-managed host and custom-header settings are inherited from Soenneker.GitLab.HttpClients:
{
"GitLab": {
"ApiKey": "gitlab-token",
"ClientBaseUrl": "https://gitlab.example.com/",
"AuthHeaderName": "PRIVATE-TOKEN",
"AuthHeaderValueTemplate": "{token}"
}
}
Registration
services.AddGitLabOpenApiClientUtilAsSingleton();
Use AddGitLabOpenApiClientUtilAsScoped() when the consumer should be scoped. The scoped utility still uses the singleton HTTP provider; disposing a scope releases its cached OpenAPI wrapper without removing the shared authenticated transport.
Usage
public sealed class GitLabService
{
private readonly IGitLabOpenApiClientUtil _clients;
public GitLabService(IGitLabOpenApiClientUtil clients)
{
_clients = clients;
}
public async ValueTask<GitLabOpenApiClient> GetClient(
CancellationToken cancellationToken = default)
{
return await _clients.Get(cancellationToken);
}
}
Get returns the same generated client for the lifetime of the utility. Authentication is supplied by the underlying HTTP provider, so the Kiota adapter does not add a second authorization header.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.GitLab.HttpClients (>= 11.0.201)
- Soenneker.GitLab.OpenApiClient (>= 11.0.221)
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 |
|---|---|---|
| 11.0.372 | 45 | 12/5/2026 |
| 11.0.371 | 53 | 12/3/2026 |
| 11.0.370 | 52 | 12/3/2026 |
| 11.0.369 | 62 | 12/3/2026 |
| 11.0.368 | 64 | 12/3/2026 |
| 11.0.367 | 71 | 12/2/2026 |
| 11.0.366 | 77 | 12/2/2026 |
| 11.0.365 | 66 | 12/2/2026 |
| 11.0.364 | 61 | 12/2/2026 |
| 11.0.363 | 75 | 12/2/2026 |
| 11.0.362 | 66 | 12/2/2026 |
| 11.0.361 | 74 | 12/2/2026 |
| 11.0.360 | 86 | 12/2/2026 |
| 11.0.359 | 87 | 12/2/2026 |
| 11.0.358 | 83 | 12/2/2026 |
| 11.0.357 | 82 | 12/1/2026 |
| 11.0.356 | 80 | 12/1/2026 |
| 11.0.355 | 94 | 12/1/2026 |
| 11.0.354 | 85 | 12/1/2026 |
| 11.0.353 | 88 | 12/1/2026 |
Update dependency Soenneker.GitLab.OpenApiClient to 11.0.221 (#475)