JustworksSpecConfiguration

abstract class JustworksSpecConfiguration @Inject constructor(name: String) : Named(source)

Configuration for a single OpenAPI spec in the Justworks multi-spec DSL.

Each spec is independently configured with its own OpenAPI file path, package structure, and generates to an isolated output directory.

Usage in build.gradle.kts:

justworks {
specs {
register("petstore") {
specFile = file("api/petstore.yaml")
packageName = "com.example.petstore"
}
}
}

This class implements Named to work with Gradle's org.gradle.api.NamedDomainObjectContainer. The name is injected via constructor and determines the task name and output directory.

Constructors

Link copied to clipboard
@Inject
constructor(name: String)

Properties

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

Prefix for generated API client class names. Defaults to "".

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

Suffix for generated API client class names. Defaults to "Api" (e.g. tag pets ->PetsApi).

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

Package for generated API client classes. Defaults to "$packageName.api" if not set.

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

Whether to generate an interface per API tag that the client class implements. Defaults to false. When enabled, the interface keeps the configured name (e.g. PetsApi) and the concrete client gets an Impl suffix (PetsApiImpl).

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

Whether to emit KDoc comments in generated code. Defaults to true. Set to false to reduce generated file size and noise.

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

Package for generated model/data classes. Defaults to "$packageName.model" if not set.

Link copied to clipboard
open override val name: String
Link copied to clipboard
abstract val packageName: Property<String>

Base package name for generated code (e.g., "com.example.api").

Link copied to clipboard
abstract val specFile: RegularFileProperty

Path to the OpenAPI spec file (.yaml or .json).

Functions

Link copied to clipboard
open override fun getName(): String