KotlinxSchemaExtension

abstract class KotlinxSchemaExtension @Inject constructor(source)

Extension for configuring the Kotlinx Schema Gradle plugin.

Example usage:

kotlinxSchema {
enabled.set(true)
rootPackage.set("com.example.models")
withSchemaObject.set(true)
}

Constructors

Link copied to clipboard
@Inject
constructor()

Properties

Link copied to clipboard
abstract val enabled: Property<Boolean>

Whether schema generation is enabled. Default: true

Link copied to clipboard
abstract val exclude: Property<String>

Comma- or semicolon-separated glob patterns of fully qualified names to exclude from schema generation. Applies to both classes and functions. Exclusions are applied after include; a symbol matching any exclude pattern is always skipped.

Link copied to clipboard
abstract val include: Property<String>

Comma- or semicolon-separated glob patterns of fully qualified names to include in schema generation. Applies to both classes and functions. If not set, all symbols within rootPackage are included.

Link copied to clipboard
abstract val rootPackage: Property<String>

Optional root package to limit processing to. If set, only classes in this package (or its subpackages) will be processed by KSP. If not set, all packages are processed.

Link copied to clipboard
abstract val visibility: Property<String>

Configures the visibility of schema extension functions/properties generated by the Kotlinx Schema Gradle plugin. This property determines the modifier (e.g., "public", "internal") applied to the generated schema-related APIs.

Link copied to clipboard
abstract val withSchemaObject: Property<Boolean>

Whether to generate the jsonSchema JsonObject property in addition to jsonSchemaString. When enabled, both extension properties are generated: