2.2.0

(feat): We now provide endpoint methods for streaming byte array requests in addition to the previous methods accepting byte array directly.

(chore): Bump Jackson version to latest (2.17.2)



2.0.0

(break): The SDK generator is now on major version 2. To take this upgrade without any breaks, please add the below configuration to your generators.yml file:

1generators:
2 - name: fernapi/fern-java-sdk
3 config:
4 disable-required-property-builder-checks: true

(feat): Generated builder methods now enforce non-null checks for required fields, ensuring that all required fields are properly validated during object construction:

1@java.lang.Override
2@JsonSetter("name")
3public NameStage name(@NotNull String name) {
4 this.name = Objects.requireNonNull(name, "name must not be null");
5 return this;
6}


1.0.5

(fix): Fixed a bug where local generation custom config doesn’t pick up some values, including exception naming.




1.0.2-rc0

(feat): The generator now adds a class-level @JsonInclude(JsonInclude.Include.NON_ABSENT) annotation to each generated type in place of the previous @JsonInclude(JsonInclude.Include.NON_EMPTY) by default. This is configurable in the generators.yml file:

1generators:
2 - name: fernapi/fern-java-sdk
3 config:
4 json-include: non-empty # default non-absent

1.0.1

(break): The Java SDK is now on major version 1. To take this upgrade without any breaks, please add the below configuration to your generators.yml file:

1generators:
2 - name: fernapi/fern-java-sdk
3 config:
4 base-api-exception-class-name: ApiError
5 base-exception-class-name: CompanyException # Optional: This should only be set if default naming is undesirable

(feat): We now generate Exception types for all errors that are defined in the IR. Generated clients with an error discrimination strategy of “status code” will throw one of these typed Exceptions based on the status code of error responses. Example error type:

1public final class BadRequest extends MyCompanyApiError {
2 public BadRequest(Object body) {
3 super("BadRequest", 400, body);
4 }
5}

0.10.1

(feat): Add support for cursor and offset pagination.

What’s new

  • Add support for cursor and offset pagination.

For example, consider the following endpoint /users endpoint:

1types:
2 User:
3 properties:
4 name: string
5
6 ListUserResponse:
7 properties:
8 next: optional<string>
9 data: list<User>
10
11service:
12 auth: false
13 base-path: /users
14 endpoints:
15 list:
16 path: ""
17 method: GET
18 pagination:
19 cursor: $request.starting_after
20 next_cursor: $response.next
21 results: $response.data
22 request:
23 name: ListUsersRequest
24 query-parameters:
25 starting_after: optional<string>
26 response: ListUsersResponse

The generated SyncPagingIterable<User> can then be used to traverse through the User objects:

1for (User user : client.users.list(...)) {
2 System.out.println(user);
3}

Or stream them:

1client.users.list(...).streamItems().map(user -> ...);

Or statically calling nextPage() to perform the pagination manually:

1SyncPagingIterable<User> pager = client.users.list(...);
2// First page
3System.out.println(pager.getItems());
4// Second page
5pager = pager.nextPage();
6System.out.println(pager.getItems());