Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyw520 committed Dec 23, 2024
1 parent 4558891 commit fff8340
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,15 @@ private TypeSpec createBuilder(Map<VariableId, FieldSpec> variableFields) {
.initializer("new $T<>()", HashMap.class)
.build())
.addField(FieldSpec.builder(TypeName.INT, TIMEOUT_FIELD.name, Modifier.PRIVATE)
.initializer("0")
.initializer("60")
.build())
.addFields(variableFields.values())
.addMethod(getEnvironmentBuilder())
.addMethod(getHeaderBuilder())
.addMethod(getHeaderSupplierBuilder())
.addMethod(MethodSpec.methodBuilder("timeout")
.addModifiers(Modifier.PUBLIC)
.addJavadoc("Override the timeout in seconds. Defaults to 60 seconds.")
.returns(builderClassName)
.addParameter(TypeName.INT, TIMEOUT_FIELD.name)
.addStatement("this.$L = $L", TIMEOUT_FIELD.name, TIMEOUT_FIELD.name)
Expand Down
6 changes: 6 additions & 0 deletions generators/java/sdk/versions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
- changelogEntry:
- summary: |
Implement global timeout configuration for generated clients.
```java
var client = Client.builder()
.apiKey("...")
.timeout(40)
.build();
```
type: feat
createdAt: '2024-12-23'
irVersion: 53
Expand Down

0 comments on commit fff8340

Please sign in to comment.