@@ -317,7 +317,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
317
317
// core_v1_event->action
318
318
cJSON * action = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "action" );
319
319
if (action ) {
320
- if (!cJSON_IsString (action ))
320
+ if (!cJSON_IsString (action ) && ! cJSON_IsNull ( action ) )
321
321
{
322
322
goto end ; //String
323
323
}
@@ -326,7 +326,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
326
326
// core_v1_event->api_version
327
327
cJSON * api_version = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "apiVersion" );
328
328
if (api_version ) {
329
- if (!cJSON_IsString (api_version ))
329
+ if (!cJSON_IsString (api_version ) && ! cJSON_IsNull ( api_version ) )
330
330
{
331
331
goto end ; //String
332
332
}
@@ -371,7 +371,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
371
371
// core_v1_event->kind
372
372
cJSON * kind = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "kind" );
373
373
if (kind ) {
374
- if (!cJSON_IsString (kind ))
374
+ if (!cJSON_IsString (kind ) && ! cJSON_IsNull ( kind ) )
375
375
{
376
376
goto end ; //String
377
377
}
@@ -389,7 +389,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
389
389
// core_v1_event->message
390
390
cJSON * message = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "message" );
391
391
if (message ) {
392
- if (!cJSON_IsString (message ))
392
+ if (!cJSON_IsString (message ) && ! cJSON_IsNull ( message ) )
393
393
{
394
394
goto end ; //String
395
395
}
@@ -407,7 +407,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
407
407
// core_v1_event->reason
408
408
cJSON * reason = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "reason" );
409
409
if (reason ) {
410
- if (!cJSON_IsString (reason ))
410
+ if (!cJSON_IsString (reason ) && ! cJSON_IsNull ( reason ) )
411
411
{
412
412
goto end ; //String
413
413
}
@@ -422,7 +422,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
422
422
// core_v1_event->reporting_component
423
423
cJSON * reporting_component = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "reportingComponent" );
424
424
if (reporting_component ) {
425
- if (!cJSON_IsString (reporting_component ))
425
+ if (!cJSON_IsString (reporting_component ) && ! cJSON_IsNull ( reporting_component ) )
426
426
{
427
427
goto end ; //String
428
428
}
@@ -431,7 +431,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
431
431
// core_v1_event->reporting_instance
432
432
cJSON * reporting_instance = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "reportingInstance" );
433
433
if (reporting_instance ) {
434
- if (!cJSON_IsString (reporting_instance ))
434
+ if (!cJSON_IsString (reporting_instance ) && ! cJSON_IsNull ( reporting_instance ) )
435
435
{
436
436
goto end ; //String
437
437
}
@@ -452,31 +452,31 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
452
452
// core_v1_event->type
453
453
cJSON * type = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "type" );
454
454
if (type ) {
455
- if (!cJSON_IsString (type ))
455
+ if (!cJSON_IsString (type ) && ! cJSON_IsNull ( type ) )
456
456
{
457
457
goto end ; //String
458
458
}
459
459
}
460
460
461
461
462
462
core_v1_event_local_var = core_v1_event_create (
463
- action ? strdup (action -> valuestring ) : NULL ,
464
- api_version ? strdup (api_version -> valuestring ) : NULL ,
463
+ action && ! cJSON_IsNull ( action ) ? strdup (action -> valuestring ) : NULL ,
464
+ api_version && ! cJSON_IsNull ( api_version ) ? strdup (api_version -> valuestring ) : NULL ,
465
465
count ? count -> valuedouble : 0 ,
466
466
event_time && !cJSON_IsNull (event_time ) ? strdup (event_time -> valuestring ) : NULL ,
467
467
first_timestamp && !cJSON_IsNull (first_timestamp ) ? strdup (first_timestamp -> valuestring ) : NULL ,
468
468
involved_object_local_nonprim ,
469
- kind ? strdup (kind -> valuestring ) : NULL ,
469
+ kind && ! cJSON_IsNull ( kind ) ? strdup (kind -> valuestring ) : NULL ,
470
470
last_timestamp && !cJSON_IsNull (last_timestamp ) ? strdup (last_timestamp -> valuestring ) : NULL ,
471
- message ? strdup (message -> valuestring ) : NULL ,
471
+ message && ! cJSON_IsNull ( message ) ? strdup (message -> valuestring ) : NULL ,
472
472
metadata_local_nonprim ,
473
- reason ? strdup (reason -> valuestring ) : NULL ,
473
+ reason && ! cJSON_IsNull ( reason ) ? strdup (reason -> valuestring ) : NULL ,
474
474
related ? related_local_nonprim : NULL ,
475
- reporting_component ? strdup (reporting_component -> valuestring ) : NULL ,
476
- reporting_instance ? strdup (reporting_instance -> valuestring ) : NULL ,
475
+ reporting_component && ! cJSON_IsNull ( reporting_component ) ? strdup (reporting_component -> valuestring ) : NULL ,
476
+ reporting_instance && ! cJSON_IsNull ( reporting_instance ) ? strdup (reporting_instance -> valuestring ) : NULL ,
477
477
series ? series_local_nonprim : NULL ,
478
478
source ? source_local_nonprim : NULL ,
479
- type ? strdup (type -> valuestring ) : NULL
479
+ type && ! cJSON_IsNull ( type ) ? strdup (type -> valuestring ) : NULL
480
480
);
481
481
482
482
return core_v1_event_local_var ;
0 commit comments