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
                    
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="Eternet.AspNetCore.ApiGateway.Generator" Version="1.1.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eternet.AspNetCore.ApiGateway.Generator" Version="1.1.18" />
                    
Directory.Packages.props
<PackageReference Include="Eternet.AspNetCore.ApiGateway.Generator" />
                    
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 Eternet.AspNetCore.ApiGateway.Generator --version 1.1.18
                    
#r "nuget: Eternet.AspNetCore.ApiGateway.Generator, 1.1.18"
                    
#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 Eternet.AspNetCore.ApiGateway.Generator@1.1.18
                    
#: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=Eternet.AspNetCore.ApiGateway.Generator&version=1.1.18
                    
Install as a Cake Addin
#tool nuget:?package=Eternet.AspNetCore.ApiGateway.Generator&version=1.1.18
                    
Install as a Cake Tool

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:

  • AdditionalFiles ending in .eternet.endpoint-model.json, normally produced by referenced contract packages.
  • EternetApiGatewayContractManifest items for explicit manifest overrides.
  • EternetApiGatewayContractAssembly items for assembly fallback when no sidecar exists.
  • source OpenAPI modules from EternetApiGatewaySourceOpenApiDirectory.
  • EternetApiGatewaySourceOpenApi items 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:

  • generatedAtUtc
  • sourceOpenApiDirectory
  • outputOpenApiDirectory
  • pathRewriteDirectory
  • projectedOperations
  • warnings

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/Generator had its own contract package-reference list.

The contracts-first model is:

  • Billing contract packages publish endpoint-model sidecars;
  • Eternet.Api.Rest references Billing contracts once;
  • ProjectApiGatewayContracts consumes 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.
There are no supported framework assets in this package.

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
Loading failed