Eternet.AspNetCore.ApiGateway.Generator
1.1.18
Prefix Reserved
dotnet add package Eternet.AspNetCore.ApiGateway.Generator --version 1.1.18
NuGet\Install-Package Eternet.AspNetCore.ApiGateway.Generator -Version 1.1.18
<PackageReference Include="Eternet.AspNetCore.ApiGateway.Generator" Version="1.1.18" />
<PackageVersion Include="Eternet.AspNetCore.ApiGateway.Generator" Version="1.1.18" />
<PackageReference Include="Eternet.AspNetCore.ApiGateway.Generator" />
paket add Eternet.AspNetCore.ApiGateway.Generator --version 1.1.18
#r "nuget: Eternet.AspNetCore.ApiGateway.Generator, 1.1.18"
#:package Eternet.AspNetCore.ApiGateway.Generator@1.1.18
#addin nuget:?package=Eternet.AspNetCore.ApiGateway.Generator&version=1.1.18
#tool nuget:?package=Eternet.AspNetCore.ApiGateway.Generator&version=1.1.18
Eternet.AspNetCore.ApiGateway.Generator
Eternet.AspNetCore.ApiGateway.Generator projects public API gateway OpenAPI and path rewrite artifacts from endpoint
contract manifests.
The package replaces repo-local gateway contract projection tools such as Eternet.Api/src/Generator --contracts-only.
Gateway projects should reference their contract packages once, let those references contribute endpoint-model sidecars,
and run the package-owned ProjectApiGatewayContracts MSBuild target.
Install
Reference the package from the gateway host project:
<PackageReference Include="Eternet.AspNetCore.ApiGateway.Generator"
PrivateAssets="all"
IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
Enable projection in the gateway project:
<PropertyGroup>
<EternetApiGatewayProjectionEnabled>true</EternetApiGatewayProjectionEnabled>
<EternetApiGatewayProjectionRunOnBuild>false</EternetApiGatewayProjectionRunOnBuild>
<EternetApiGatewaySourceOpenApiDirectory>$(MSBuildProjectDirectory)\OpenApis\Modules</EternetApiGatewaySourceOpenApiDirectory>
<EternetApiGatewayOutputOpenApiDirectory>$(MSBuildProjectDirectory)\OpenApis\ApiGatewayModules</EternetApiGatewayOutputOpenApiDirectory>
</PropertyGroup>
Run projection explicitly:
dotnet msbuild src\Eternet.Api.Rest\Eternet.Api.Rest.csproj -t:ProjectApiGatewayContracts -p:Configuration=Release
Inputs
The target consumes:
AdditionalFilesending in.eternet.endpoint-model.json, normally produced by referenced contract packages.EternetApiGatewayContractManifestitems for explicit manifest overrides.EternetApiGatewayContractAssemblyitems for assembly fallback when no sidecar exists.- source OpenAPI modules from
EternetApiGatewaySourceOpenApiDirectory. EternetApiGatewaySourceOpenApiitems for explicit source OpenAPI modules, either local JSON files or HTTP(S) URLs declared by contract packages.- existing public gateway OpenAPI modules and path rewrite files as the compatibility baseline.
Do not add a second generator project package-reference list for production projection. The gateway host contract references and sidecars are the source of truth.
MSBuild Properties
| Property | Default | Purpose |
|---|---|---|
EternetApiGatewayProjectionEnabled |
false |
Enables the optional before-build projection hook. |
EternetApiGatewayProjectionRunOnBuild |
false |
Runs ProjectApiGatewayContracts before Build when projection is enabled. |
EternetApiGatewaySourceOpenApiDirectory |
$(MSBuildProjectDirectory)\OpenApis\Modules |
Source service OpenAPI modules. |
EternetApiGatewayOutputOpenApiDirectory |
$(MSBuildProjectDirectory)\OpenApis\ApiGatewayModules |
Public gateway OpenAPI output directory. |
EternetApiGatewayPathRewriteDirectory |
$(EternetApiGatewayOutputOpenApiDirectory) |
Public gateway path rewrite output directory. |
EternetApiGatewayGeneratePathRewrites |
true |
Writes compatibility *.pathrewrite.json artifacts. Set to false when runtime forwarding comes directly from contract manifests. |
EternetApiGatewayProjectionReportPath |
$(IntermediateOutputPath)eternet-api-gateway-projection-report.json |
Machine-readable projection report path. |
EternetApiGatewayProjectionManifestDirectory |
$(IntermediateOutputPath)eternet-api-gateway-contracts\ |
Intermediate materialized sidecar directory. |
EternetApiGatewayFailOnProjectionWarnings |
false |
Converts projection warnings into build errors. |
EternetApiGatewayAllowNewOperations |
false |
Allows new public gateway operations when no existing public route matches. |
EternetApiGatewayIncludeAdditionalFiles |
true |
Includes endpoint-model sidecars from @(AdditionalFiles). Set to false when projection should use only explicit manifest or assembly items. |
MSBuild Items
| Item | Purpose |
|---|---|
AdditionalFiles |
Primary endpoint-model sidecar input list. |
EternetApiGatewaySourceOpenApi |
Explicit source OpenAPI module JSON files or HTTP(S) URLs. Metadata can set SourceIdentity, SourceService, and ModuleName. |
EternetApiGatewayContractManifest |
Explicit sidecar override or escape hatch. |
EternetApiGatewayContractAssembly |
Assembly fallback for contracts that do not yet publish sidecars. |
EternetApiGatewayNewOperation |
Reserved scoped opt-in model for new public operations. Global opt-in is currently controlled by EternetApiGatewayAllowNewOperations. |
Explicit EternetApiGatewayContractManifest items take precedence over overlapping AdditionalFiles by destination
filename. Assembly fallback is skipped when the matching sidecar was materialized.
Projection Report
The target writes JSON to EternetApiGatewayProjectionReportPath with:
generatedAtUtcsourceOpenApiDirectoryoutputOpenApiDirectorypathRewriteDirectoryprojectedOperationswarnings
Warnings include a stable code, deterministic message, and context fields such as source service, contract assembly,
operation name, source path, gateway path, HTTP method, route kind, and authorization source when available.
Warning Codes
| Code | Meaning |
|---|---|
EAGP001 |
Contract sidecar cannot be read. |
EAGP002 |
Source OpenAPI module not found for source service. |
EAGP003 |
Contract operation not found in source OpenAPI. |
EAGP004 |
Contract HTTP method differs from source OpenAPI. |
EAGP005 |
Existing public gateway path cannot be found and new operations are not allowed. |
EAGP006 |
Multiple public gateway operations match one contract operation. |
EAGP007 |
Duplicate projected route signature. |
EAGP008 |
Authorization CRUD differs between endpoint transport and explicit auth metadata. |
EAGP009 |
ApiGatewayEndpoint route conflicts with an explicit AuthorizationEndpoint route. |
EAGP010 |
OData projection route is missing or normalized to /. |
EAGP011 |
Legacy fallback metadata was used because manifest metadata is incomplete. |
Keep EternetApiGatewayFailOnProjectionWarnings=false during migration. Turn it on in CI after known contract metadata
gaps are closed or explicitly accepted.
Billing Migration Model
Billing used the old hybrid model:
- source OpenAPI and gateway JSON carried part of the public route metadata;
- contracts carried partial endpoint metadata;
- authorization metadata could drift between contract metadata and generator inference;
Eternet.Api/src/Generatorhad its own contract package-reference list.
The contracts-first model is:
- Billing contract packages publish endpoint-model sidecars;
Eternet.Api.Restreferences Billing contracts once;ProjectApiGatewayContractsconsumes the sidecars and existing gateway JSON compatibility baseline;- MSBuild writes
OpenApis/ApiGatewayModules/*.json,*.pathrewrite.json, and the projection report; - warnings identify missing source operations, route mismatches, CRUD/auth drift, duplicate public routes, and fallback metadata before approval snapshots drift silently.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
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 |
|---|---|---|
| 1.1.18 | 96 | 9/11/2026 |
| 1.1.17 | 99 | 9/7/2026 |
| 1.1.16 | 132 | 8/30/2026 |
| 1.1.15 | 99 | 8/29/2026 |
| 1.1.14 | 109 | 8/21/2026 |
| 1.1.13 | 179 | 8/19/2026 |
| 1.1.12 | 116 | 8/15/2026 |
| 1.1.11 | 106 | 8/14/2026 |
| 1.1.10 | 102 | 8/13/2026 |
| 1.1.9 | 107 | 8/12/2026 |
| 1.1.8 | 103 | 8/11/2026 |
| 1.1.7 | 132 | 8/1/2026 |
| 1.1.6 | 120 | 7/29/2026 |
| 1.1.5 | 116 | 7/26/2026 |
| 1.1.4 | 112 | 7/25/2026 |
| 1.1.3 | 111 | 7/25/2026 |
| 1.1.2 | 116 | 7/25/2026 |
| 1.1.1 | 127 | 7/25/2026 |
| 1.1.0 | 112 | 7/24/2026 |
| 1.0.28 | 115 | 7/24/2026 |