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 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: