Background image
Featured blog post image

Changelog: Java General Availability and managed OAuth support

New features to the Speakeasy Platform - March, 2024

Another changelog, another massive improvement to our SDK generation. This month, it’s Java’s turn for a GA makeover. But our other languages aren’t gathering dust. We’ve added support for managed OAuth2.0 client credentials flow, and flattened response objects.

Let’s jump into it 🚀

Java General Availability

Java is inevitable. You can have your head turned by all the new & exciting languages that are being created, but if you are serving a large organization, you will need to be ready to support Java.

Which is why we are excited to announce that Java is now Generally Available on the Speakeasy Platform! General availability means that every feature of our generation platform is now available for Java. As a bonus, we’ve taken this work as an opportunity to completely revamp the developer experience. Here are the highlights of what’s changed:

  • Enhanced null safety and Optional support
  • Builder patterns for better readability, discoverability, and convenient overloads
  • Lists instead of arrays for collections
  • No direct field access (getter methods are used now)
  • A simplified Gradle project structure
  • Support for non-discriminated oneOfs
  • Auto-Pagination
  • Retry support
  • OAuth2.0 support

Check out the new interface:

public class Application {
public static void main(String[] args) {
try {
MyPlatform sdk = MyPlatform.builder()
.security(Security.builder()
.authHeader("Basic BASE_64_ENCODED(API_KEY)")
.build())
.build();
UserRequestBody req = UserRequestBody.builder()
.name("Saj Batchu")
.role(RoleType.ADMIN)
.workspaces(java.util.List.of(
workspaceRef.builder()
.id("60d2fa12-8a04-11ee-b9d1-0242ac120002")
.build()))
.build();
CreateUserResponse res = sdk.user().create()
.request(req)
.call();
if (res.user().isPresent()) {
// handle response
}
} catch (Exception e) {
// handle exception
}
}
}

For the details, please read the full announcement here.

🚢 Improvements and Bug Fixes 🐛

Based on most recent version: Speakeasy v1.210.0 (opens in a new tab)

🚢 Handle flat responses for empty status codes
🚢 Fail schema validation if missing a server
🚢 Propagate defaults for examples in parameters

Typescript

🚢 Support Empty Error types
🚢 Add support for response formats and flat responses
🚢 Add managed OAuth2.0 client credentials flow support (as a SDK hook)
🚢 Handle null enums fields and union members
🐛 Fix missing imports with flat responses

Java

🚢 Support passing in additional dependencies in the SDK
🚢 Support callAsStream autopagination syntax
🐛 Fix typo in README.md Error Handling section

Python

🚢 Add support for response formats and flat responses

Terraform

🚢 Use the default http client in TF to remove timeouts

C#

🚢 Support naming servers

Go

🚢 Add support for response formats and flat responses