Skip to navigation

Java configuration

View as Markdown

Configure the Java SDK in the generation block of its target in sdk-config.yml:

sdk-config.yml
targets:
- language: java
generation:
naming:
clientName: YourClientName
packageLayout: flat
useLocalDateForDates: true
collapseOptionalNullable: true

The target’s generation block also accepts the shared generation options, such as naming, wireTests, and customCode. Shared options set in the top-level generation block apply to every target, and a target’s generation block overrides them. For generators.yml options, see the Legacy Java configuration.

Java options

<ParamField path=“packageLayout” type=""flat” | “nested"" required= toc=> Whether generated JVM packages use a flat or nested resource layout. </ParamField>

useLocalDateForDates
boolean

Whether date-only values use LocalDate instead of OffsetDateTime.

collapseOptionalNullable
boolean

Whether optional nullable values collapse into a single nullable representation.

gradleDistributionUrl
string

The Gradle distribution URL written to the generated wrapper.

gradlePluginManagement
string

Plugin management configuration added to the generated Gradle settings.

gradleCentralDependencyManagement
boolean

Whether dependency versions are managed centrally in the Gradle project.

<ParamField path=“asyncStyle” type=""dedicated-client” | “twin-methods"" required= toc=> Whether asynchronous operations use a separate client or co-located methods. </ParamField>

includeKotlinSnippets
boolean

Whether Java SDK documentation includes Kotlin usage snippets.