+
+
+
+ Modelina lets you generate data models from many types of{' '}
+ inputs
+
+ |
+
+
+ {`const asyncapi = ...
const jsonschema = ...
const openapi = ...
const metamodel = ...
@@ -139,48 +148,50 @@ const metamodel = ...
const models = await generator.generate(
asyncapi | jsonschema | openapi | metamodel
);`}
-
- |
-
-
-
-
- Use the same inputs across a range of different{' '}
- generators
-
- |
-
-
- {`const generator = new TypeScriptGenerator();
+
+ |
+
+
+
+
+
+ Use the same inputs across a range of different{' '}
+ generators
+
+ |
+
+
+ {`const generator = new TypeScriptGenerator();
const generator = new CsharpGenerator();
const generator = new JavaGenerator();
const generator = new RustGenerator();
...
const models = await generator.generate(input);`}
-
- |
-
-
-
+
+ |
+
+
+
+
+
Easily let you interact with the generated models.-
Want to show the generated models on a website? Sure! - Want
to generate the models into files? Sure! - Want to combine all
the models into one single file? Sure! Whatever interaction
you need, you can create.
- |
-
-
- {`const models = await generator.generate(input);
+
+ |
+
+
+ {`const models = await generator.generate(input);
for (const model in models) {
const generatedCode = generatedModel.result;
const dependencies = generatedModel.dependencies;
@@ -188,26 +199,25 @@ for (const model in models) {
const modelName = generatedModel.modelName;
...
}`}
-
- |
-
-
-
-
- Easily modify how models are{' '}
- constrained into the
- output
-
- |
+
+
+
-
-
- {`const generator = new TypeScriptGenerator({
+
+
+
+ Easily modify how models are{' '}
+ constrained into the
+ output
+
+ |
+
+
+ {`const generator = new TypeScriptGenerator({
constraints: {
modelName: ({modelName}) => {
// Implement your own constraining logic
@@ -215,28 +225,27 @@ for (const model in models) {
}
}
});`}
-
- |
-
-
-
-
- Seamlessly layer additional or replacement code{' '}
-
- on top of each other to customize the models
- {' '}
- to your use-case
-
- |
+
+
+
-
-
- {`const generator = new TypeScriptGenerator({
+
+
+
+ Seamlessly layer additional or replacement code{' '}
+
+ on top of each other to customize the models
+ {' '}
+ to your use-case
+
+ |
+
+
+ {`const generator = new TypeScriptGenerator({
presets: [
{
class: {
@@ -251,27 +260,26 @@ public myCustomFunction(): string {
]
});
const models = await generator.generate(input);`}
-
- |
-
-
-
-
- Seamlessly lets you{' '}
-
- combine multiple layers of additional or replacement code
-
-
- |
+
+
+
-
-
- {`const myCustomFunction1 = {
+
+
+
+ Seamlessly lets you{' '}
+
+ combine multiple layers of additional or replacement code
+
+
+ |
+
+
+ {`const myCustomFunction1 = {
class: {
additionalContent({ content }) {
return \`\${content}
@@ -289,12 +297,11 @@ const generator = new TypeScriptGenerator({
]
});
const models = await generator.generate(input);`}
-
- |
-
- | | |
-