|
2 | 2 | title: Java Configuration |
3 | 3 | description: Configuration options for the Fern Java SDK. |
4 | 4 | --- |
| 5 | +You can customize the behavior of the Java SDK generator in `generators.yml`: |
5 | 6 |
|
6 | | -Discover how to configure the Fern Java SDK for your project. |
| 7 | +```yaml {7-9} |
| 8 | +default-group: local |
| 9 | +groups: |
| 10 | + local: |
| 11 | + generators: |
| 12 | + - name: fernapi/fern-java-sdk |
| 13 | + version: <Markdown src="/snippets/version-number.mdx"/> |
| 14 | + config: |
| 15 | + client_class_name: YourApiClient |
| 16 | +``` |
7 | 17 |
|
8 | | -<Warning>This page is a WIP, please refer to our previous [documentation](https://buildwithfern.com/learn/sdks/reference/configuration).</Warning> |
| 18 | +## SDK Configuration Options |
| 19 | +
|
| 20 | +<ParamField path="client-class-name" type="string" default="<Organization>ApiClient" required={false}> |
| 21 | +
|
| 22 | +The provided string will be used as the client class name. |
| 23 | +</ParamField> |
| 24 | +
|
| 25 | +<ParamField path="base-api-exception-class-name" type="string" required={false}> |
| 26 | +</ParamField> |
| 27 | +
|
| 28 | +<ParamField path="base-exception-class-name" type="string" required={false}> |
| 29 | +</ParamField> |
| 30 | +
|
| 31 | +<ParamField path="custom-dependencies" type="List<string>" required={false}> |
| 32 | +
|
| 33 | +Example: |
| 34 | +
|
| 35 | + ```yaml |
| 36 | + custom-dependencies: |
| 37 | + - "implementation com.foo:bar:0.0.0" |
| 38 | + - "testImplementation com.foo:bar:0.0.0" |
| 39 | + - "api com.foo:bar:0.0.0" |
| 40 | + ``` |
| 41 | +
|
| 42 | +</ParamField> |
| 43 | +
|
| 44 | +<ParamField path="publish-to" type="'central' | 'ossrh'" required={false}> |
| 45 | +</ParamField> |
| 46 | +
|
| 47 | +<ParamField path="inline-file-properties" type="boolean" default="false" required={false}> |
| 48 | +</ParamField> |
| 49 | +
|
| 50 | +<ParamField path="wrapped-aliases" type="boolean" default="false" required={false}> |
| 51 | + When enabled, generates wrapper types for each alias to increase type-safety. |
| 52 | +For example, if you have an alias `ResourceId: string` then if this is true, the |
| 53 | +generator will generate a `ResourceId.java` file. If false, it will just treat it |
| 54 | +as `java.util.String`. |
| 55 | +</ParamField> |
| 56 | + |
| 57 | +<ParamField path="enable-forward-compatible-enums" type="boolean" default="false" required={false}> |
| 58 | +</ParamField> |
| 59 | + |
| 60 | +<ParamField path="generate-unknown-as-json-node" type="boolean" default="false" required={false}> |
| 61 | +</ParamField> |
| 62 | + |
| 63 | +<ParamField path="json-include" type="'non-empty' | 'non-absent'" default="non-absent" required={false}> |
| 64 | +</ParamField> |
| 65 | + |
| 66 | +<ParamField path="enable-public-constructors" type="boolean" default="false" required={false}> |
| 67 | + |
| 68 | +When enabled, generates public constructors for model types. |
| 69 | +</ParamField> |
| 70 | + |
| 71 | +<ParamField path="disable-required-property-builder-checks" type="boolean" default="false" required={false}> |
| 72 | +</ParamField> |
| 73 | + |
| 74 | +<ParamField path="inline-path-parameters" type="boolean" default="false" required={false}> |
| 75 | +</ParamField> |
| 76 | + |
| 77 | +<ParamField path="enable-inline-types" type="boolean" default="false" required={false}> |
| 78 | +</ParamField> |
| 79 | + |
| 80 | +<ParamField path="package-prefix" type="string" required={false}> |
| 81 | +</ParamField> |
| 82 | + |
| 83 | +<ParamField path="package-layout" type="'nested' | 'flat'" default="nested" required={false}> |
| 84 | +</ParamField> |
0 commit comments