Modelina can be used in many different contexts and has many features, all depending on the output language. This document will walk you through you the library's basic usages.
For more advanced use-cases, please check out the advanced document.
For more specific integration options, please check out the integration document.
- Understanding the output format
- Generate models from AsyncAPI documents
- Generate models from JSON Schema documents
- Generate models from Swagger 2.0 documents
- Generate models from OpenAPI documents
- Generate models from TypeScript type files
- Generate Go models
- Generate C# models
- Generate Java models
- Generate TypeScript models
- Generate JavaScript models
- Generate Dart models
TODO
When providing an AsyncAPI document, the library iterates the entire document and generate models for all defined messages. If any other kind of iteration is wanted, feel free to create a feature request.
There are two ways to generate models for an AsyncAPI document.
The library expects the asyncapi
property for the document to be set in order to understand the input format.
The message payloads, since it is a JSON Schema variant, is interpreted as a such.
There is one way to generate models for a JSON Schema document.
We support both draft-4, draft-6, and draft-7 documents.
The library expects the $schema
property for the document to be set in order to understand the input format. By default, if no other inputs are detected, it defaults to JSON Schema draft 7
. The process of interpreting a JSON Schema to a model can be read here.
There are one way to generate models from a Swagger 2.0 document
The Swagger input processor expects that the property swagger
is defined in order to know it should be processed.
The response payload and body
parameters, since it is a JSON Schema variant, is interpreted as a such.
There are one way to generate models from an OpenAPI document
The OpenAPI input processor expects that the property openapi
is defined in order to know it should be processed.
The response and request payloads, since it is a JSON Schema variant, is interpreted as a such.
Currently, we support generating models from a TypeScript type file.
The TypeScript input processor expects that the typescript file and base directory where it's present, is passed as input, in order to process the types accurately.
Go is one of the many output languages we support. Check out this basic example for a live demonstration and the following Go documentation for more advanced use-cases.
C# is one of the many output languages we support. Check out this basic example for a live demonstration and the following C# documentation for more advanced use-cases.
Java is one of the many output languages we support. Check out this basic example for a live demonstration and the following Java documentation for more advanced use-cases.
TypeScript is one of the many output languages we support. Check out this basic example for a live demonstration and the following TypeScript documentation for more advanced use-cases.
JavaScript is one of the many output languages we support. Check out this basic example for a live demonstration and the following JavaScript documentation for more advanced use-cases.
Dart is one of the many output languages we support. Check out this basic example for a live demonstration and the following Dart documentation for more advanced use-cases.