AsyncAPI Conference 2022

Help us decide on a date and location by filling out a short survey

Modelina

Sometimes you just want to generate data models for your payload.

Installation & Usage

Start using Modelina really quickly. Select one of the available languages we offer and start generating models from your AsyncAPI document in a few seconds.

npm install @asyncapi/modelina
View on Github
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { JavaGenerator, JAVA_COMMON_PRESET } from '@asyncapi/modelina'
  
const generator = new JavaGenerator({
  collectionType: "List",
  presets: [
    {
      preset: JAVA_COMMON_PRESET,
      options: {
        classToString: true
      }
    }
  ]
});

// const input = ...AsyncAPI document
const models = await generator.generate(input)

Modelina Playground works only on the desktop devices.