Class JsonSchemaExtension
- java.lang.Object
-
- org.creekservice.api.json.schema.gradle.plugin.JsonSchemaExtension
-
- All Implemented Interfaces:
org.gradle.api.plugins.ExtensionAware
public abstract class JsonSchemaExtension extends java.lang.Object implements org.gradle.api.plugins.ExtensionAwareGradle extension for configuring schema generation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonSchemaExtension.TypeScanningSpecGradle extension for configuring which packages and modules are included when scanning for subtypes.
-
Constructor Summary
Constructors Constructor Description JsonSchemaExtension()Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidextraArguments(java.lang.String... args)Set additional args to pass to the schema generator.abstract org.gradle.api.provider.ListProperty<java.lang.String>getExtraArguments()Optional list of additional arguments to pass to the generator.abstract org.gradle.api.provider.Property<java.lang.String>getOutputDirectoryName()Optional name of the directory under theresource rootwhere the schema will be written.abstract org.gradle.api.file.DirectoryPropertygetSchemaResourceRoot()Optional resource root where generated schemas should be storedJsonSchemaExtension.TypeScanningSpecgetSubtypeScanning()Configure type scanning for finding subtypes, i.e.JsonSchemaExtension.TypeScanningSpecgetTypeScanning()Configure type scanning for finding types to generate schema for, i.e.
-
-
-
Method Detail
-
getTypeScanning
public JsonSchemaExtension.TypeScanningSpec getTypeScanning()
Configure type scanning for finding types to generate schema for, i.e. types annotated withGeneratesSchema.- Returns:
- the type scanning config
-
getSubtypeScanning
public JsonSchemaExtension.TypeScanningSpec getSubtypeScanning()
Configure type scanning for finding subtypes, i.e. subtypes of polymorphic types that are part of base types.- Returns:
- the type scanning config
-
getSchemaResourceRoot
public abstract org.gradle.api.file.DirectoryProperty getSchemaResourceRoot()
Optional resource root where generated schemas should be storedDefault:
$buildDir/generated/resources/schema- Returns:
- the resource root property.
-
getOutputDirectoryName
public abstract org.gradle.api.provider.Property<java.lang.String> getOutputDirectoryName()
Optional name of the directory under theresource rootwhere the schema will be written.This corresponds to the directory under which schema files will be located within the compiled jar file.
Default:
schema/json- Returns:
- output directory name property.
-
getExtraArguments
public abstract org.gradle.api.provider.ListProperty<java.lang.String> getExtraArguments()
Optional list of additional arguments to pass to the generator.See https://github.com/creek-service/creek-json-schema/tree/main/generator for more info.
Default: none.
- Returns:
- extra args property.
-
extraArguments
public void extraArguments(java.lang.String... args)
Set additional args to pass to the schema generator.See
getExtraArguments()for more info.- Parameters:
args- the extra args to pass to the generator.
-
-