Skip to content

Commit 1090267

Browse files
docs: swap examples used in readme (#388)
docs: document how to forcibly omit required field
1 parent 9040df4 commit 1090267

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,20 @@ JsonValue complexValue = JsonValue.from(Map.of(
453453
));
454454
```
455455

456+
Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.
457+
458+
To forcibly omit a required parameter or property, pass [`JsonMissing`](orb-java-core/src/main/kotlin/com/withorb/api/core/Values.kt):
459+
460+
```java
461+
import com.withorb.api.core.JsonMissing;
462+
import com.withorb.api.models.CustomerCreateParams;
463+
464+
CustomerCreateParams params = CustomerCreateParams.builder()
465+
.name("x")
466+
.email(JsonMissing.of())
467+
.build();
468+
```
469+
456470
### Response properties
457471

458472
To access undocumented response properties, call the `_additionalProperties()` method:

0 commit comments

Comments
 (0)