Commit 0ccdcde
Document null handling behavior in declareField to match REST
Add comprehensive javadoc explaining null handling behavior:
1. If value is null:
- Parser and consumer NOT called (no-op)
- Matches REST behavior when field not present in JSON
2. If value is not null:
- Parser transforms the value
- Consumer called with transformed value
3. If parser returns null:
- Consumer STILL called with null
- Setter is responsible for null validation (matches REST)
This clarifies that the null-check behavior perfectly mirrors REST's
ObjectParser pattern, where absent fields result in no parser/consumer
invocation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent cb8a4ed commit 0ccdcde
File tree
1 file changed
+13
-1
lines changed- modules/transport-grpc/src/main/java/org/opensearch/transport/grpc/proto/request/common
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| |||
87 | 96 | | |
88 | 97 | | |
89 | 98 | | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
93 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| |||
0 commit comments