Schema class generation tools

In order to simplify the usage of serialization schemas, native classes for the programming language of choice can often be generated.

As a serialization schema can be used in many languages (i.e. sending events from a Java application, and receiving with a NodeJS application), consistency is key between the events that are serialized and deserialized.

Therefore, it is useful to generate classes for serialization schemas. Stream Machine offers utilities to make this process easier.

Generating classes

The repository for the class generation tools can be found here. To use the tools, follow these steps:

  1. Clone the repository: git clone https://github.com/streammachineio/schema-tools

  2. Navigate to the root of the repository

  3. Ensure you have the full reference to the serialization schema for which you want to generate classes, i.e. streammachine/clickstream/0.2.0

  4. Generate the classes: python -m cli generate typescript avro "streammachine/clickstream/0.2.0"

  5. Find the generated classes under the generated directory.

The schema generation tools repository is a work in progress and features will be added over time
Known schemas can be requested via the public API, which is not yet available in the CLI

The generated classes can be seen as a starter project, which can be included in your existing project. Another option would be to publish the resulting generated projects as a single artifact to your own artifactory (i.e. Maven / PyPi / NPM / et cetera), and use that as a dependency in your application that will be sending events.

Supported languages / serialization formats

Avro JSON Schema

Java

✅ Supported

❌ Not yet supported

Python

✅ Supported

❌ Not yet supported

TypeScript

✅ Supported

❌ Not yet supported