---
id: types-export
title: "Export types"
summary: "Export a flow type and the types it uses as C#, Python, Go, Java, PHP, TypeScript or JSON Schema, and how the JSON contract represents decimals, dates, times, identifiers, binary data, geometry, enums, lists and nullable values."
audience: user
keywords: "export, code generation, csharp, python, go, java, php, typescript, json schema, yaml, contract, decimal, datetime, timespan, guid, enum, nullable, contract hash"
---
# 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.

| Format | What you get | Needs |
|---|---|---|
| **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 |
| **Python** | A module of dataclasses with `to_dict` / `from_dict`, `IntEnum`s, and `dumps` / `loads` that keep decimals exact. | Python 3.10 or later, standard library only |
| **Go** | Structs 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 |
| **Java** | Classes nested in one `<Type>Contract` class, with Jackson annotations and a configured `MAPPER`. | Java 17 or later, Jackson 2.15 or later |
| **PHP** | Classes with typed properties, `fromJson` / `toJson`, int-backed enums and exact decimals. | PHP 8.1 or later, no packages |
| **TypeScript** | Interfaces 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.**

| Type | In JSON |
|---|---|
| `Decimal` | a number, kept exact in every language (`decimal`, `Decimal`, `BigDecimal`, exact string handling in Go and PHP) |
| `DateTimeOffset` | an ISO 8601 date and time, always with an offset |
| `DateTime` | an ISO 8601 date and time, with `Z` or an offset when the value has one |
| `DateOnly` | an ISO 8601 date |
| `TimeOnly` | `hh:mm:ss` with optional fractions |
| `TimeSpan` | `[-][d.]hh:mm:ss[.fffffff]` |
| `Guid` | a UUID string |
| byte array | a base64 string |
| IP and MAC address | a string |
| Geometry | a WKT string, such as `POINT (15.98 45.81)` |
| `Int64` / `UInt64` | an integer (`UInt64` becomes `BigInteger` in Java and a string in PHP) |
| `Single` / `Double` | a number |
| `Object` | any 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.
