Class GenerationSpec
java.lang.Object
com.ennovativesolutions.modelina.gradle.GenerationSpec
Configuration for a single Modelina generation. Multiple generations can be declared inside the
modelina { generations { ... } } block, each producing its own generation task.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptions passed togenerateToFiles, e.g.abstract org.gradle.api.file.RegularFilePropertyThe input document to generate models from.abstract org.gradle.api.provider.Property<String> Target output language.getName()The name of this generation, as declared in the DSL.abstract org.gradle.api.provider.Property<String> Convenience for thenamespacecomplete-model option (C#).Options passed to the generator constructor, e.g.abstract org.gradle.api.file.DirectoryPropertyDirectory the generated source files are written to.abstract org.gradle.api.provider.Property<String> Convenience for thepackageNamecomplete-model option (Java, Kotlin, Scala, Go, Python, ...).abstract org.gradle.api.provider.ListProperty<Object> Modelina presets to apply.Values made available to thetransform scriptascontext.env.abstract org.gradle.api.file.RegularFilePropertyOptional ECMAScript module that pre-processes the parsed input document before generation.
-
Constructor Details
-
GenerationSpec
-
-
Method Details
-
getName
The name of this generation, as declared in the DSL. Used to derive the task name. -
getLanguage
Target output language. One of:java,typescript,csharp,cplusplus,dart,go,kotlin,javascript,php,python,rust,scala. -
getInputFile
public abstract org.gradle.api.file.RegularFileProperty getInputFile()The input document to generate models from. May be an AsyncAPI, OpenAPI, JSON Schema, Avro, Swagger or Meta-model document, in JSON or YAML. -
getOutputDir
public abstract org.gradle.api.file.DirectoryProperty getOutputDir()Directory the generated source files are written to. -
getPresets
Modelina presets to apply. Each entry is either a preset constant name (e.g.'JAVA_JACKSON_PRESET') or a map binding options to a preset (e.g.[name: 'JAVA_CONSTRAINTS_PRESET', options: [useJakarta: true]]). Names map to the preset constants exported by the@asyncapi/modelinapackage. -
getOptions
-
getCompleteOptions
-
getPackageName
Convenience for thepackageNamecomplete-model option (Java, Kotlin, Scala, Go, Python, ...). Merged intogetCompleteOptions(). -
getNamespace
Convenience for thenamespacecomplete-model option (C#). Merged intogetCompleteOptions(). -
getTransformScript
public abstract org.gradle.api.file.RegularFileProperty getTransformScript()Optional ECMAScript module that pre-processes the parsed input document before generation. It must export a default function(document, context) => root | root[]returning one or more self-contained root schemas. When set, each returned root is run throughgenerateCompleteModels, results are deduplicated by model name, and the plugin writes the files itself (the output directory is emptied first). Use this for input shapes Modelina cannot consume directly (e.g. unwrapping a CloudEvents envelope, titling anonymous schemas). -
getTransformEnv
Values made available to thetransform scriptascontext.env. Use for transform-specific knobs such as a root title or message name.
-