Examples

This directory contains a series of self-contained examples to help you get started or show how a specific feature can be utilized. The examples also serve the purpose of being part of the testing workflow to ensure they always work!

We love contributions and new examples that does not already exist, you can follow this guide to contribute one!


Groups of Examples


Input examples

These examples show a specific input and how they can be used:

General examples

These are examples that can be applied in all scenarios.

  • include-custom-function - A basic example where a custom function is included.
  • overwrite-naming-formatting - A basic example how to overwrite default naming format constraint in this case, overwriting returning a constant case format.
  • overwrite-default-constraint - A basic example how to overwrite the entire constraint logic and not just a single part of the default behavior, in this case overwriting the model naming constraint.
  • custom-logging - A basic example where a custom logger is used.
  • generate-to-files - A basic example that shows how you can generate the models directly to files.
  • indentation-type-and-size - This example shows how to change the indentation type and size of the generated model.
  • change-type-mapping - A basic example showing how to change the type of a model in some context.
  • change-type-mapping-with-dependency - A basic example showing how to use the dependency manager to inject your own custom type with a dependency instead of the default type.

Simple generator examples

These are all the basic generator examples that shows a bare minimal example of a generator:

Integrations

These are examples of how you can integrate Modelina into a specific scenario:

  • integrate-with-react - A basic example that shows how you can integrate Modelina with React.
  • integrate-with-next - A basic example that shows how you can integrate Modelina with Next.
  • integrate-with-maven - A basic example that shows how you can integrate Modelina into the Java Maven build process.

Language examples

These are all the examples for each language;

Python

These are all specific examples only relevant to the Python generator:

JavaScript

These are all specific examples only relevant to the JavaScript generator:

Java

These are all specific examples only relevant to the Java generator:

C#

These are all specific examples only relevant to the C# generator:

TypeScript

These are all specific examples only relevant to the TypeScript generator:

Kotlin

These are all specific examples only relevant to the Kotlin generator:

PHP

These are all specific examples only relevant to the PHP generator:

Scala

These are all specific examples only relevant to the Scala generator:

Rust

These are all specific examples only relevant to the Rust generator;

Dart

These are all specific examples only relevant to the Dart generator:

Go

These are all specific examples only relevant to the Go generator;

C++

These are all specific examples only relevant to the C++ generator;

Other examples

Miscellaneous examples that do not fit into the otherwise grouping.

  • TEMPLATE - A basic template used to create new examples.