Skip to content
Open
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
25 changes: 24 additions & 1 deletion fern/products/sdks/generators/java/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Controls how the offset parameter is interpreted for [auto-paginated](/learn/sdk
</ParamField>

<ParamField path="omit-fern-headers" type="boolean" default="false" required={false} toc={true}>
When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, and `X-Fern-SDK-Version` headers from HTTP requests.
When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, `X-Fern-SDK-Version`, and `User-Agent` headers from HTTP requests.
</ParamField>

<ParamField path="package-layout" type="'nested' | 'flat'" default="nested" required={false} toc={true}>
Expand All @@ -126,6 +126,29 @@ Publish target for Maven packages. Use `central` for Maven Central Portal or `os
When enabled, generates `java.time.LocalDate` instead of `String` for Fern date types. This provides better type safety and enables compile-time validation for date values, while maintaining the same string wire format for API communication.
</ParamField>

<ParamField path="user-agent" type="string" default="{packageName}/{version}" required={false} toc={true}>
Sets a custom `User-Agent` header template for requests sent by the generated SDK. The template is resolved at generation time and supports the following placeholders:

* `{packageName}`: The published package name.
* `{version}`: The SDK version.
* `{language}`: The generation language (for example, `java`).
* `{generatorVersion}`: The Fern generator version.
* `{organization}`: The organization name from `fern.config.json`.
* `{apiName}`: The API name from your API definition.

```yaml title="generators.yml"
groups:
java-sdk:
generators:
- name: fern-java-sdk
version: <Markdown src="/snippets/version-number-java.mdx"/>
config:
user-agent: "{organization}-plantstore/{version} ({language})"
```

With this configuration, the generated SDK sends a header such as `User-Agent: plantstore-api/0.1.0 (java)`.
</ParamField>

<ParamField path="wrapped-aliases" type="boolean" default="false" required={false} toc={true}>
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
Expand Down
Loading