You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type of indentation. Its value can be either SPACES or TABS and are typed by IndentationTypes
SPACES
indentation.size
String
Size of indentation.
2
defaultPreset
Object
Default preset for generator. For more information, read customization document.
Implemented by generator
presets
Array
Array contains presets. For more information, read customization document.
[]
In addition, generators take additional options when calling their renderCompleteModel(input, options) functions.
This allows the caller to specify additional options when generating a multi-file model from the input with cross dependencies.
Below is a list of additional options available for a given generator.
It indicates which mapping type should be rendered for the object type. Its value can be one of map, record or indexedObject.
map
modelType
String
It indicates which model type should be rendered for the object type. Its value can be either interface or class.
class
enumType
String
It indicates which type should be rendered for the enum type. Its value can be either union or enum.
enum
namingConvention
Object
Options for naming conventions.
-
namingConvention.type
Function
A function that returns the format of the type.
Returns pascal cased name, and ensures that reserved keywords are never rendered_
namingConvention.property
Function
A function that returns the format of the property.
Returns camel cased name, and ensures that names of properties does not clash against reserved keywords for TS, as well as JS to ensure painless transpilation
Render complete model options
Option
Type
Description
Default value
moduleSystem
'ESM' | 'CJS'
Which module system the generated files should use (import or require)
'CJS'
exportType
'default' | 'named'
Whether the exports should be default or named exports
Must define language options by passing an interface describing additional options to the first generic argument of AbstractGenerator. The interface must also be extended by CommonGeneratorOptions interface,
Must define default options as static class's field, which must be extended by defaultGeneratorOptions,
Default options must include defaultPreset property,
Must implement render function,
Must define Renderers classes for available model types in a given language. Renderer is an instance of the class with common helper functions to render appropriate model type and must be extended by AbstractRenderer class - example.