Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 78 additions & 2 deletions fern/products/sdks/overview/java/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,83 @@
title: Java Configuration
description: Configuration options for the Fern Java SDK.
---
You can customize the behavior of the Java SDK generator in `generators.yml`:

Discover how to configure the Fern Java SDK for your project.
```yaml {7-9}
default-group: local
groups:
local:
generators:
- name: fernapi/fern-java-sdk
version: <Markdown src="/snippets/version-number.mdx"/>
config:
client_class_name: YourApiClient
```

<Warning>This page is a WIP, please refer to our previous [documentation](https://buildwithfern.com/learn/sdks/reference/configuration).</Warning>
## SDK Configuration Options

<ParamField path="client-class-name" type="string" default="<Organization>ApiClient" required={false}>

The provided string will be used as the client class name.
</ParamField>

<ParamField path="base-api-exception-class-name" type="string" required={false}>
</ParamField>

<ParamField path="base-exception-class-name" type="string" required={false}>
</ParamField>

<ParamField path="custom-dependencies" type="List<string>" required={false}>

Example:

```yaml
custom-dependencies:
- "implementation com.foo:bar:0.0.0"
- "testImplementation com.foo:bar:0.0.0"
- "api com.foo:bar:0.0.0"
```

</ParamField>

<ParamField path="publish-to" type="'central' | 'ossrh'" required={false}>
</ParamField>

<ParamField path="inline-file-properties" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="wrapped-aliases" type="boolean" default="false" required={false}>
When enabled, generates wrapper types for each alias to increase type-safety.
For example, if you have an alias `ResourceId: string` then if this is true, the
generator will generate a `ResourceId.java` file. If false, it will just treat it
as `java.util.String`.
</ParamField>

<ParamField path="enable-forward-compatible-enums" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="generate-unknown-as-json-node" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="json-include" type="'non-empty' | 'non-absent'" default="non-absent" required={false}>
</ParamField>

<ParamField path="enable-public-constructors" type="boolean" default="false" required={false}>

When enabled, generates public constructors for model types.
</ParamField>

<ParamField path="disable-required-property-builder-checks" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="inline-path-parameters" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="enable-inline-types" type="boolean" default="false" required={false}>
</ParamField>

<ParamField path="package-prefix" type="string" required={false}>
</ParamField>

<ParamField path="package-layout" type="'nested' | 'flat'" default="nested" required={false}>
</ParamField>