Cohesive.Adapters.OpenApi
0.1.0-alpha.121
dotnet add package Cohesive.Adapters.OpenApi --version 0.1.0-alpha.121
NuGet\Install-Package Cohesive.Adapters.OpenApi -Version 0.1.0-alpha.121
<PackageReference Include="Cohesive.Adapters.OpenApi" Version="0.1.0-alpha.121" />
<PackageVersion Include="Cohesive.Adapters.OpenApi" Version="0.1.0-alpha.121" />
<PackageReference Include="Cohesive.Adapters.OpenApi" />
paket add Cohesive.Adapters.OpenApi --version 0.1.0-alpha.121
#r "nuget: Cohesive.Adapters.OpenApi, 0.1.0-alpha.121"
#:package Cohesive.Adapters.OpenApi@0.1.0-alpha.121
#addin nuget:?package=Cohesive.Adapters.OpenApi&version=0.1.0-alpha.121&prerelease
#tool nuget:?package=Cohesive.Adapters.OpenApi&version=0.1.0-alpha.121&prerelease
Cohesive.Adapters.OpenApi
OpenAPI document emission and endpoint helpers for Cohesive API declarations.
Install
dotnet add package Cohesive.Adapters.OpenApi
Use When
- You want OpenAPI artifacts generated from Cohesive API declarations.
- You need endpoint helpers for publishing generated OpenAPI documents.
- You want OpenAPI, GraphQL, and TypeScript clients to share one semantic API source.
Example
using Cohesive.Adapters.OpenApi;
using Cohesive.Api;
var api = Api.Define("Shipping")
.Entity<ShipmentDto>()
.Query("Get")
.Route("GET", "/shipments/{id}")
.RouteParameter<string>("id")
.Returns<ShipmentDto>()
.Done()
.Build();
var document = new OpenApiEmitter().Emit(api).Documents.Single();
app.MapCohesiveOpenApi(api);
Related Packages
Cohesive.Apifor API declarations.Cohesive.CodeGen.Clifor build-time artifact generation.
Public JSON contracts
Supply OpenApiEmitterOptions.JsonSerializerOptions to project a public document contract from the
same serializer metadata used on the wire. This supports recursive records, explicit polymorphic
cases and converter-backed scalar identifiers while keeping portable document storage admission separate.
The CLI selects this profile with --shape-projection canonical-json for OpenAPI as well as shapes.
The profile rejects property-specific converters/number-handling overrides and polymorphic cases without explicit discriminators. Unknown converter output stays opaque; CLR implementation members are not substituted for a converter schema. Native document semantic validation remains authoritative. See typed portable JSON contracts for the projection boundary and qualification.
Nested serializer profiles
A property converter implementing IJsonValueSerializerProfile declares the frozen options it uses
for the complete nested value. OpenAPI follows that profile instead of applying the envelope's
naming and converter rules. WebJsonPropertyConverter<T> exposes its existing shared web profile.
Each profile receives a separate type-to-schema cache within an emission; component names remain
unique across profiles. Recursive references therefore preserve the selected profile even when the
same CLR type is also serialized by the outer envelope. Mutable profiles and unrecognized custom
property converters remain unsupported with explicit diagnostics. This support does not imply
profile-aware TypeScript or GraphQL projection.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Cohesive (>= 0.1.0-alpha.121)
- Cohesive.Api (>= 0.1.0-alpha.121)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Cohesive.Adapters.OpenApi:
| Package | Downloads |
|---|---|
|
Cohesive.CodeGen.Cli
Cohesive semantic system definition and orchestration building blocks. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.121 | 6 | 10/2/2026 |
| 0.1.0-alpha.120 | 52 | 9/29/2026 |
| 0.1.0-alpha.119 | 38 | 9/29/2026 |
| 0.1.0-alpha.118 | 58 | 9/29/2026 |
| 0.1.0-alpha.117 | 64 | 9/27/2026 |
| 0.1.0-alpha.116 | 61 | 9/26/2026 |
| 0.1.0-alpha.115 | 73 | 9/26/2026 |
| 0.1.0-alpha.114 | 63 | 9/24/2026 |
| 0.1.0-alpha.113 | 66 | 9/24/2026 |
| 0.1.0-alpha.112 | 66 | 9/23/2026 |
| 0.1.0-alpha.111 | 68 | 9/23/2026 |
| 0.1.0-alpha.110 | 62 | 9/23/2026 |
| 0.1.0-alpha.109.1 | 60 | 9/23/2026 |
| 0.1.0-alpha.109 | 58 | 9/23/2026 |
| 0.1.0-alpha.108 | 66 | 9/21/2026 |
| 0.1.0-alpha.107 | 54 | 9/21/2026 |
| 0.1.0-alpha.106 | 62 | 9/21/2026 |
| 0.1.0-alpha.105 | 54 | 9/21/2026 |
| 0.1.0-alpha.104 | 74 | 9/21/2026 |
| 0.1.0-alpha.103 | 64 | 9/21/2026 |