Skip to content

Commit 0a06490

Browse files
docs: revise readme docs about nested params (#143)
1 parent e8882a7 commit 0a06490

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,23 @@ ProjectCreateParams params = ProjectCreateParams.builder()
373373
.build();
374374
```
375375

376-
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods. You can also set undocumented parameters on nested headers, query params, or body classes using the `putAdditionalProperty` method. These properties can be accessed on the built object later using the `_additionalProperties()` method.
376+
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.
377+
378+
To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:
379+
380+
```java
381+
import com.braintrustdata.api.core.JsonValue;
382+
import com.braintrustdata.api.models.ProjectSettings;
383+
import com.braintrustdata.api.models.ProjectUpdateParams;
384+
385+
ProjectUpdateParams params = ProjectUpdateParams.builder()
386+
.settings(ProjectSettings.builder()
387+
.putAdditionalProperty("secretProperty", JsonValue.from("42"))
388+
.build())
389+
.build();
390+
```
391+
392+
These properties can be accessed on the nested built object later using the `_additionalProperties()` method.
377393

378394
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/JsonValue.kt) object to its setter:
379395

0 commit comments

Comments
 (0)