Commit 7ac15ea
committed
fix: improve serialize-nulls in additional properties
This commit improves the behavior of the DynamicModelTypeAdapterFactory's
serialization function so that we support the serialization of null values
found within additional properties in a more accurate way.
1. A null-valued additional property will be serialized as null in the JSON.
2. A null-valued normal property that is set as an additional property
will NOT be serialized as a null.
3. The above "serialize nulls" behavior also applies to additional property
values which are model instances.1 parent 372f4d9 commit 7ac15ea
File tree
2 files changed
+67
-5
lines changed- src
- main/java/com/ibm/cloud/sdk/core/util
- test/java/com/ibm/cloud/sdk/core/test/model
2 files changed
+67
-5
lines changedLines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
| 294 | + | |
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
| 301 | + | |
299 | 302 | | |
300 | 303 | | |
301 | 304 | | |
| |||
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
339 | 346 | | |
340 | | - | |
341 | 347 | | |
342 | 348 | | |
343 | | - | |
344 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
345 | 363 | | |
346 | 364 | | |
347 | 365 | | |
| |||
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
208 | 223 | | |
209 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
210 | 254 | | |
211 | 255 | | |
212 | 256 | | |
| |||
0 commit comments