Skip to content

Export types ​

The applications that send data to a flow, or receive it, need the same types. Export them instead of writing them by hand: every export produces ready-to-use code that reads and writes exactly the JSON the flow does.

In the type editor, select a type and click Export, then pick the format. The result opens in a viewer with Download. It contains the selected type and every type it uses, in one file.

FormatWhat you getNeeds
C#Classes with System.Text.Json attributes, enums, default values, and a <Type>Json helper with Serialize and Deserialize..NET 8 or later, no packages
PythonA module of dataclasses with to_dict / from_dict, IntEnums, and dumps / loads that keep decimals exact.Python 3.10 or later, standard library only
GoStructs with JSON tags, pointers for nullable values, New<Type>() constructors with defaults, and helper types for decimals, dates and durations.Go 1.24 or later, standard library only
JavaClasses nested in one <Type>Contract class, with Jackson annotations and a configured MAPPER.Java 17 or later, Jackson 2.15 or later
PHPClasses with typed properties, fromJson / toJson, int-backed enums and exact decimals.PHP 8.1 or later, no packages
TypeScriptInterfaces that describe the JSON, with numeric enums.-
JSON Schema / JSON Schema (YAML)A JSON Schema 2020-12 document, for any other language or tool.-

The C# namespace, the Go package and the Java package follow the type's namespace.

The JSON contract ​

Every format follows the same rules, so a record written by one side is read correctly by the other.

Names. A field appears in JSON under its Serialization name, or under its field name when none is set. A field with JSON ignore: Always is not part of the contract. A field is required in the schema when it is never left out (JSON ignore: Never).

Values.

TypeIn JSON
Decimala number, kept exact in every language (decimal, Decimal, BigDecimal, exact string handling in Go and PHP)
DateTimeOffsetan ISO 8601 date and time, always with an offset
DateTimean ISO 8601 date and time, with Z or an offset when the value has one
DateOnlyan ISO 8601 date
TimeOnlyhh:mm:ss with optional fractions
TimeSpan[-][d.]hh:mm:ss[.fffffff]
Guida UUID string
byte arraya base64 string
IP and MAC addressa string
Geometrya WKT string, such as POINT (15.98 45.81)
Int64 / UInt64an integer (UInt64 becomes BigInteger in Java and a string in PHP)
Single / Doublea number
Objectany JSON value

Enums are written as their integer values. Their names travel in the schema (x-enum-varnames), so the generated code has named members. As dictionary keys, enums are written by name.

Lists are JSON arrays; dictionaries are JSON objects with string, number, Guid or enum keys.

Nullable values may be null.

Every export carries a contract hash, a short fingerprint of the JSON shape. Two sides with the same hash agree on the contract; webhook clients send it with every call so a flow can warn about, or reject, a sender that uses an old version of a type.

TypeScript reads JSON numbers as JavaScript numbers, so decimals with many digits lose precision there. Use the Python, Java, Go, PHP or C# export where exact amounts matter.

Fields that are left out ​

Some .NET types have no JSON form: streams, exceptions, BitArray. Fields of these types, and script-only properties, are left out of the export with a warning in the file header (C#) or in the schema.

Viaducta documentation