Java Configuration Options

This section details the available configuration options for the TypeScript SDK. All configuration is managed in the gen.yaml file under the java section.

Version and General Configuration

java:
version: 1.2.3
projectName: "openapi"
NameRequiredDefault ValueDescription
versiontrue0.0.1The current version of the SDK.
projectNametrueopenapiAssigns Gradle rootProject.name, which names the Gradle build. See Gradle Naming (opens in a new tab).

Publishing

java:
groupID: "com.mycompany"
artifactID: "my-sdk"
ossrhURL: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
githubURL: "https://github.com/mycompany/my-sdk"
companyName: "My Company"
companyURL: "https://www.mycompany.com"
companyEmail: "support@mycompany.com"
NameRequiredDefault ValueDescription
groupIDtrueorg.openapisThe group ID used for namespacing the package. Typically the reversed domain of your organization.
artifactIDtrueopenapiThe artifact ID used for namespacing the package, usually the name of the project.
ossrhURLfalseN/AThe URL of the staging repository to publish the SDK artifact to.
githubURLfor publishinggithub.com/owner/repoThe GitHub URL where the artifact is hosted. Sets metadata required by Maven.
companyNamefor publishingMy CompanyThe name of your company. Sets metadata required by Maven.
companyURLfor publishingwww.mycompany.comYour company’s homepage URL. Sets metadata required by Maven.
companyEmailfor publishinginfo@mycompany.comA support email address for your company. Sets metadata required by Maven.

Additional Dependencies

java:
additionalDependencies:
- "implementation:com.fasterxml.jackson.core:jackson-databind:2.12.3"
- "testImplementation:junit:junit:4.13.2"
NameRequiredDefault ValueDescription
additionalDependenciesfalse[]Specify additional dependencies to include in build.gradle. Format: scope:groupId:artifactId:version.
additionalPluginsfalse[]Specify additional plugins to include in build.gradle. Format: id("plugin.id") version "x.x.x".

License

java:
license:
name: "The MIT License (MIT)"
url: "https://mit-license.org/"
shortName: "MIT"
NameRequiredDefault ValueDescription
licensefalseMIT LicenseLicense information. Defaults to the MIT license if not otherwise specified.

Method and Paramater Management

java:
maxMethodParams: 4
NameRequiredDefault ValueDescription
maxMethodParamsfalse4Maximum number of parameters before an input object is created. 0 means input objects are always used.

Security Configuratiaon

java:
flattenGlobalSecurity: true
PropertyDescriptionTypeDefault
flattenGlobalSecurityEnables inline security credentials during SDK instantiation. Recommended: truebooleantrue

Module Management

java:
moduleFormat: "dual"
useIndexModules: true
NameRequiredDefault ValueDescription
useIndexModulesfalsetrueDetermines if index modules (index.ts) are generated.
moduleFormatfalsecommonjsSpecifies the module format to use when compiling the SDK (commonjs, esm, or dual).

Import Management

java:
imports:
paths:
callbacks: models/callbacks
errors: models/errors
operations: models/operations
shared: models/components
webhooks: models/webhooks
FieldRequiredDefault ValueDescription
pathsfalse{}Customizes where different parts of the SDK (e.g., callbacks, errors, operations) will be imported from.

Import Paths

ComponentDefault ValueDescription
callbacksmodels/callbacksThe directory where callback models will be imported from.
errorsmodels/errorsThe directory where error models will be imported from.
operationsmodels/operationsThe directory where operation models (i.e., API endpoints) will be imported from.
sharedmodels/componentsThe directory for shared components, such as reusable schemas and data models, imported from the OpenAPI spec.
webhooksmodels/webhooksThe directory for webhook models, if your SDK includes support for webhooks.

Error and Response Handling

java:
clientServerStatusCodesAsErrors: false
NameRequiredDefault ValueDescription
clientServerStatusCodesAsErrorsfalsetrueWhether to treat 4xx and 5xx status codes as errors. Options: true or false.