Skip to main content
Documentation

Sidex Documentation

Define shared data models and generate code for every part of your stack.

Sidex is a data modeling language. A schema describes the structure of your data independently of a programming language. Code generators turn that schema into Rust types, TypeScript types, Python models, and JSON Schema.

Use Sidex for data that crosses a boundary: API requests and responses, configuration files, persistent data, or messages shared by several applications.

Start with a Working Model

The getting started guide takes you from a new bundle to generated code with a small task model. A bundle is a directory containing a sidex.toml manifest and a schemas directory.

Already have a model? Choose your target:

TargetGenerated OutputGuide
RustStructs, enums, newtypes, and optional Serde, builder, and validation implementationsRust
TypeScriptTypes matching the JSON representation, nominal wrappers, and optional validatorsTypeScript
PythonPydantic models, root models, and JSON adaptersPython
JSON SchemaSchema documents for concrete JSON representationsJSON Schema

Understand the Model

A record groups named fields. A variant describes a choice between cases. Wrappers create distinct types, aliases reuse existing types, and opaque types leave their implementation to a target language.

Attributes attach additional information to the model. They can set JSON field names, map a type to a native implementation, declare validation rules, or describe an API’s lifecycle.

Keep a Shared Contract

A schema’s type structure and its JSON representation are related but separate. Read JSON mapping before exchanging data between languages. Validation rules add application constraints such as size limits or numeric ranges.

For an existing API, lifecycle attributes record when items were introduced and how they should be retired. Request metadata pairs a request with its response type for custom tooling.

Find a Specific Setting

The reference covers CLI commands, the bundle manifest, and built-in attributes. To build your own generator or attribute plugin, see extending Sidex.