Class JsonSchemaExtension

  • All Implemented Interfaces:
    org.gradle.api.plugins.ExtensionAware

    public abstract class JsonSchemaExtension
    extends java.lang.Object
    implements org.gradle.api.plugins.ExtensionAware
    Gradle extension for configuring schema generation
    • Constructor Detail

      • JsonSchemaExtension

        public JsonSchemaExtension()
        Constructor
    • Method Detail

      • getTypeScanning

        public JsonSchemaExtension.TypeScanningSpec getTypeScanning()
        Configure type scanning for finding types to generate schema for, i.e. types annotated with GeneratesSchema.
        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 stored

        Default: $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 the resource root where 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.