Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import com.fern.ir.model.http.SdkRequestWrapper;
import com.fern.ir.model.ir.Subpackage;
import com.fern.ir.model.types.ContainerType;
import com.fern.ir.model.types.ObjectProperty;
import com.fern.ir.model.types.ObjectTypeDeclaration;
import com.fern.ir.model.types.TypeDeclaration;
import com.fern.ir.model.types.TypeReference;
import com.fern.java.client.ClientGeneratorContext;
import com.fern.java.client.generators.visitors.RequestPropertyToNameVisitor;
Expand Down Expand Up @@ -357,6 +360,40 @@ public Void visitInlinedRequestBody(InlinedRequestBody inlinedRequestBody) {

@Override
public Void visitReference(com.fern.ir.model.http.HttpRequestBodyReference reference) {
TypeReference requestBodyType = reference.getRequestBodyType();
if (requestBodyType.isNamed()) {
TypeDeclaration typeDeclaration = generatorContext
.getTypeDeclarations()
.get(requestBodyType.getNamed().get().getTypeId());
if (typeDeclaration != null
&& typeDeclaration.getShape().isObject()) {
ObjectTypeDeclaration objectType =
typeDeclaration.getShape().getObject().get();
for (ObjectProperty prop : objectType.getProperties()) {
String propName =
prop.getName().getName().getCamelCase().getUnsafeName();
RequestPropertyInfo oauthProp = allOAuthProperties.get(propName);
if (oauthProp == null) {
continue;
}

processedProperties.add(propName);
boolean isLiteral = isLiteralType(prop.getValueType());
boolean isOptional = isOptionalType(prop.getValueType());

BuilderProperty builderProp =
new BuilderProperty(propName, oauthProp.fieldName, isLiteral);

if (isLiteral) {
continue;
} else if (isOptional) {
optionalProperties.add(builderProp);
} else {
requiredProperties.add(builderProp);
}
}
}
}
return null;
}

Expand Down
11 changes: 11 additions & 0 deletions generators/java/sdk/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
- version: 3.23.2
changelogEntry:
- summary: |
Fix OAuthTokenSupplier builder method ordering to match staged builder sequence. When
generating OAuth token supplier code for request types with staged builders, the builder
method calls are now generated in the correct order based on the type's property declaration
order, preventing compilation errors.
type: fix
createdAt: "2025-12-08"
irVersion: 61

- version: 3.23.1
changelogEntry:
- summary: |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions seed/java-sdk/java-oauth-staged-builder/default/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

224 changes: 224 additions & 0 deletions seed/java-sdk/java-oauth-staged-builder/default/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading