OutWit.Cloud.Documents.Generator
1.0.0
dotnet add package OutWit.Cloud.Documents.Generator --version 1.0.0
NuGet\Install-Package OutWit.Cloud.Documents.Generator -Version 1.0.0
<PackageReference Include="OutWit.Cloud.Documents.Generator" Version="1.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="OutWit.Cloud.Documents.Generator" Version="1.0.0" />
<PackageReference Include="OutWit.Cloud.Documents.Generator"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add OutWit.Cloud.Documents.Generator --version 1.0.0
#r "nuget: OutWit.Cloud.Documents.Generator, 1.0.0"
#:package OutWit.Cloud.Documents.Generator@1.0.0
#addin nuget:?package=OutWit.Cloud.Documents.Generator&version=1.0.0
#tool nuget:?package=OutWit.Cloud.Documents.Generator&version=1.0.0
OutWit.Cloud.Documents.Generator
Build-time generator for the OmnibusCloud job document vocabulary. A controller author annotates the model DTOs that native (non-.NET) initiators may send and receive:
[JobDocumentContract("render.options@1")]
public sealed class RenderOptionsData : ModelBase { ... }
and this package, referenced by the model project as a build-time dependency, turns those annotations into the artifacts hosts consume:
| Artifact | Purpose |
|---|---|
<component>.schema.json |
JSON Schema 2020-12 fragment: one $defs entry per published type id and per referenced enum, with x-oc-* vendor keywords (type id, binding name, CLR wire name) |
<component>_documents.hpp |
Header-only C++17 binding: enum class + struct per type, to_json() / to_parameter_json(), no dependencies |
<component>_documents.py |
Standard-library-only Python binding: str enums + keyword-only dataclasses, to_json() / from_json() / to_parameter() |
The generator reads the compiled model assembly the same way the server's
vocabulary scan does (metadata only, attribute matched by full name), so a
model package may declare its own copy of JobDocumentContractAttribute and
take on no new dependency; and it records the wire shape exactly as the
server's System.Text.Json materialization produces it (camelCase names,
enum member names as strings, nulls omitted). What the generator publishes,
the server accepts.
Usage
<ItemGroup>
<PackageReference Include="OutWit.Cloud.Documents.Generator" Version="1.0.*" PrivateAssets="all" />
</ItemGroup>
The package also compiles an internal copy of
OutWit.Cloud.Documents.JobDocumentContractAttribute into the model, so the
attribute is available without any reference to OutWit.Cloud.Contracts
(server and generator match it by full name). Every build then writes the
artifacts to <project>/Documents/ (commit them: a wire-shape change is a
reviewable diff). Under ContinuousIntegrationBuild=true the build switches
to check mode and fails with OCDOC003 when a committed artifact is stale.
Properties (set in the model csproj):
| Property | Default | Meaning |
|---|---|---|
OcDocumentsGenerate |
true |
run the generator after Build |
OcDocumentsCheck |
true when ContinuousIntegrationBuild=true, else false |
verify instead of write |
OcDocumentsOutputPath |
$(MSBuildProjectDirectory)/Documents/ |
artifact directory |
OcDocumentsEmit |
schema,cpp,python |
artifact set |
OcDocumentsIncludeAttribute |
true |
compile the internal attribute copy; set false when the project references OutWit.Cloud.Contracts |
Manual invocation (the payload is a framework-dependent .NET 10 app):
dotnet <package>/tools/net10.0/any/OutWit.Cloud.Documents.Generator.dll generate
--assembly Model.dll --reference <compiler-reference-or-dir>... --output Documents [--check]
Exit codes: 0 ok · 1 vocabulary error (OCDOC001) · 2 usage/unreadable
assembly (OCDOC000/OCDOC002) · 3 stale artifacts in check mode (OCDOC003).
What the vocabulary can express
Public instance properties with a public getter, System.Text.Json rules:
[JsonIgnore] removes, [JsonPropertyName] renames, required /
[JsonRequired] marks required, a get-only property is read-only (the
server writes it into value documents and ignores it in requests).
| CLR type | Wire | C++ | Python |
|---|---|---|---|
bool |
boolean | bool |
bool |
sbyte … ulong |
integer (format: int8 … uint64) |
int8_t … uint64_t |
int |
float, double |
number | float, double |
float |
string |
string | std::string |
str |
Guid |
string, format: uuid |
std::string (canonical text) |
uuid.UUID |
DateTime, DateTimeOffset |
string, format: date-time |
std::string (ISO 8601) |
datetime.datetime |
| enum | string (member names; [JsonStringEnumMemberName] honored) |
enum class |
str enum |
T?, nullable reference |
wire type or null | std::optional<T> |
Optional[T] |
List<T>, T[], IReadOnlyList<T>, … |
array | std::vector<T> |
list[T] |
Dictionary<string, T>, … |
object | std::map<std::string, T> |
dict[str, T] |
| another published type | object ($ref) |
struct | dataclass |
Every optional field left empty is omitted from the wire object, so the server applies its own defaults; lists and maps are always emitted.
Refused with an actionable error, never emitted partially: byte[] (blobs
travel as assets — reference them by id), unpublished nested types (annotate
them), [Flags] enums, custom [JsonConverter]s, [JsonNumberHandling],
polymorphism ([JsonPolymorphic], abstract types), generic types, recursive
types, cross-component references, decimal/TimeSpan/char/object, duplicate or
malformed ids, and types the server could not construct (no public
parameterless constructor and no property-matching constructor).
Type ids follow <component>.<name>@<major> (e.g. render.sceneRef@1).
Binding names derive from the id (RenderSceneRef; RenderSceneRefV2 from the
second major on), so a rename of the CLR type never changes what hosts see.
Related
- Schema and design principles:
Client/docs/job-request-schema.mdin the WitCloud repository. - The server door (
SubmitJobDocumentAsync/GetJobVariableDocumentAsync) and its vocabulary scan:Cloud/OutWit.Cloud/Documents/. - Native SDK header:
Client/include/omnibuscloud.h—oc_job_submit_asynccarries the request document these bindings help compose.
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.0.0 | 361 | 8/18/2026 |