IOKode.WireShape
0.1.0-dev11
Prefix Reserved
See the version list below for details.
dotnet add package IOKode.WireShape --version 0.1.0-dev11
NuGet\Install-Package IOKode.WireShape -Version 0.1.0-dev11
<PackageReference Include="IOKode.WireShape" Version="0.1.0-dev11" />
<PackageVersion Include="IOKode.WireShape" Version="0.1.0-dev11" />
<PackageReference Include="IOKode.WireShape" />
paket add IOKode.WireShape --version 0.1.0-dev11
#r "nuget: IOKode.WireShape, 0.1.0-dev11"
#:package IOKode.WireShape@0.1.0-dev11
#addin nuget:?package=IOKode.WireShape&version=0.1.0-dev11&prerelease
#tool nuget:?package=IOKode.WireShape&version=0.1.0-dev11&prerelease
WireShape
WireShape is a .NET library for declaring, once and as data, what a value looks like once written. The serializer, an OpenAPI document, the binder of a route and a generated client then read that one declaration instead of each working the form out from the type.
The form of a value is settled by the code of a converter, and nothing can read it from there. A BookingReference
is a record holding a string and travels as "QX7F2P", but a document generated from the type describes it as an
object with one member, a client generated from that document asks for an object, and the binder cannot read one
out of a route. The problem says the
rest.
The base package names no serializer. What ships covers the HTTP API of an ASP.NET Core application written with
System.Text.Json.
Installing it
The packages target net10.0 and are prerelease:
dotnet add package IOKode.WireShape --prerelease
| To | Install |
|---|---|
| Declare forms and ask a wire about them | IOKode.WireShape |
Ask System.Text.Json what a declaration does not say |
IOKode.WireShape.SystemTextJson |
| Read a declared value out of a route or a query string | IOKode.WireShape.ComponentModel |
| Say what a declaration becomes in an OpenAPI document | IOKode.WireShape.OpenApi |
| Write it into the documents Swashbuckle generates | IOKode.WireShape.Swashbuckle |
| Read the calls an ASP.NET Core application serves, as a model of its API | IOKode.WireShape.AspNetCore |
| Write a C# client of that model | IOKode.WireShape.CSharpClient |
| Hold what a wire is declared from to its rules, in your tests | IOKode.WireShape.Testing |
| Hold a document to its rules, in your tests | IOKode.WireShape.OpenApi.Testing |
A first declaration
var declaring = new WireBuilder();
var bookings = declaring.GetDeclarer("bookings");
bookings.Add<BookingReference>(new Shape.AsText(Pattern: "^[A-Z]{6}$"));
bookings.Add<Money>(new Shape.AsAnother(typeof(MoneyParts)));
var options = new JsonSerializerOptions(JsonSerializerDefaults.Web)
{
TypeInfoResolver = new DefaultJsonTypeInfoResolver()
};
options.Converters.Add(new BookingReferenceJsonConverter());
options.Converters.Add(new MoneyJsonConverter());
Wire wire = declaring.Build(new JsonSerializerOptionsSerializer(options));
wire.GetShape(typeof(BookingReference)); // a text matching '^[A-Z]{6}$'
Getting started declares the whole example, and serves a document, reads a value out of a route and writes a client from it.
Documentation
- The problem
- Getting started
- Declaring a form
- Reading declarations from a source
- Hierarchies and enumerations
- Asking the wire
- Reading a value from text
- An OpenAPI document
- A document through Swashbuckle
- Reading what an application serves
- A client of an API
- The rules
- Glossary
Versions
Every package carries one version, moved for all of them at once, and the packages of one version are built from one tree. While they are prerelease, a form, a name or a signature changes where the one before it was wrong, and nothing is kept around to make the older way of saying it still work.
License
BSD 2-Clause. See LICENSE.
| 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
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on IOKode.WireShape:
| Package | Downloads |
|---|---|
|
IOKode.WireShape.ComponentModel
Reads a declared value out of a route or a query string, through the type converters of the framework. Part of WireShape: the written form of a value, declared once as data and read by whoever has to describe it, declare it to a caller or read it back out of text. |
|
|
IOKode.WireShape.SystemTextJson
Asks System.Text.Json what a declaration does not say: the members of a type, its kinds and what an enumeration value comes out as. Part of WireShape: the written form of a value, declared once as data and read by whoever has to describe it, declare it to a caller or read it back out of text. |
|
|
IOKode.WireShape.OpenApi
Says what a declaration becomes in an OpenAPI document. Part of WireShape: the written form of a value, declared once as data and read by whoever has to describe it, declare it to a caller or read it back out of text. |
|
|
IOKode.WireShape.Testing
Rules to run in your tests over what a wire is declared from. Part of WireShape: the written form of a value, declared once as data and read by whoever has to describe it, declare it to a caller or read it back out of text. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-dev17 | 0 | 12/4/2026 |
| 0.1.0-dev16 | 319 | 11/23/2026 |
| 0.1.0-dev15 | 101 | 11/22/2026 |
| 0.1.0-dev14 | 200 | 11/16/2026 |
| 0.1.0-dev13 | 290 | 10/30/2026 |
| 0.1.0-dev12 | 117 | 10/30/2026 |
| 0.1.0-dev11 | 134 | 10/28/2026 |