diff --git a/kubernetes/model/v1_certificate_signing_request_spec.c b/kubernetes/model/v1_certificate_signing_request_spec.c index d736a8da..fad3d8de 100644 --- a/kubernetes/model/v1_certificate_signing_request_spec.c +++ b/kubernetes/model/v1_certificate_signing_request_spec.c @@ -208,15 +208,19 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "extra"); if (extra) { cJSON *extra_local_map = NULL; - if(!cJSON_IsObject(extra)) { + if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) + { goto end;//primitive map container } - extraList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(extra_local_map, extra) + if(cJSON_IsObject(extra)) { - cJSON *localMapObject = extra_local_map; - list_addElement(extraList , localMapKeyPair); + extraList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(extra_local_map, extra) + { + cJSON *localMapObject = extra_local_map; + list_addElement(extraList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1_config_map.c b/kubernetes/model/v1_config_map.c index a5ad915c..5d17a846 100644 --- a/kubernetes/model/v1_config_map.c +++ b/kubernetes/model/v1_config_map.c @@ -181,20 +181,24 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ cJSON *binary_data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "binaryData"); if (binary_data) { cJSON *binary_data_local_map = NULL; - if(!cJSON_IsObject(binary_data)) { + if(!cJSON_IsObject(binary_data) && !cJSON_IsNull(binary_data)) + { goto end;//primitive map container } - binary_dataList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(binary_data_local_map, binary_data) + if(cJSON_IsObject(binary_data)) { - cJSON *localMapObject = binary_data_local_map; - if(!cJSON_IsString(localMapObject)) + binary_dataList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(binary_data_local_map, binary_data) { - goto end; + cJSON *localMapObject = binary_data_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(binary_dataList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(binary_dataList , localMapKeyPair); } } @@ -202,20 +206,24 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "data"); if (data) { cJSON *data_local_map = NULL; - if(!cJSON_IsObject(data)) { + if(!cJSON_IsObject(data) && !cJSON_IsNull(data)) + { goto end;//primitive map container } - dataList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(data_local_map, data) + if(cJSON_IsObject(data)) { - cJSON *localMapObject = data_local_map; - if(!cJSON_IsString(localMapObject)) + dataList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(data_local_map, data) { - goto end; + cJSON *localMapObject = data_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(dataList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(dataList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_csi_persistent_volume_source.c b/kubernetes/model/v1_csi_persistent_volume_source.c index ebcb0199..638133ac 100644 --- a/kubernetes/model/v1_csi_persistent_volume_source.c +++ b/kubernetes/model/v1_csi_persistent_volume_source.c @@ -273,20 +273,24 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "volumeAttributes"); if (volume_attributes) { cJSON *volume_attributes_local_map = NULL; - if(!cJSON_IsObject(volume_attributes)) { + if(!cJSON_IsObject(volume_attributes) && !cJSON_IsNull(volume_attributes)) + { goto end;//primitive map container } - volume_attributesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(volume_attributes_local_map, volume_attributes) + if(cJSON_IsObject(volume_attributes)) { - cJSON *localMapObject = volume_attributes_local_map; - if(!cJSON_IsString(localMapObject)) + volume_attributesList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(volume_attributes_local_map, volume_attributes) { - goto end; + cJSON *localMapObject = volume_attributes_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(volume_attributesList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(volume_attributesList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_csi_volume_source.c b/kubernetes/model/v1_csi_volume_source.c index 19980771..fc267b5e 100644 --- a/kubernetes/model/v1_csi_volume_source.c +++ b/kubernetes/model/v1_csi_volume_source.c @@ -174,20 +174,24 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "volumeAttributes"); if (volume_attributes) { cJSON *volume_attributes_local_map = NULL; - if(!cJSON_IsObject(volume_attributes)) { + if(!cJSON_IsObject(volume_attributes) && !cJSON_IsNull(volume_attributes)) + { goto end;//primitive map container } - volume_attributesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(volume_attributes_local_map, volume_attributes) + if(cJSON_IsObject(volume_attributes)) { - cJSON *localMapObject = volume_attributes_local_map; - if(!cJSON_IsString(localMapObject)) + volume_attributesList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(volume_attributes_local_map, volume_attributes) { - goto end; + cJSON *localMapObject = volume_attributes_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(volume_attributesList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(volume_attributesList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_endpoint.c b/kubernetes/model/v1_endpoint.c index 97d4f48a..8969a6e6 100644 --- a/kubernetes/model/v1_endpoint.c +++ b/kubernetes/model/v1_endpoint.c @@ -243,20 +243,24 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ cJSON *deprecated_topology = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "deprecatedTopology"); if (deprecated_topology) { cJSON *deprecated_topology_local_map = NULL; - if(!cJSON_IsObject(deprecated_topology)) { + if(!cJSON_IsObject(deprecated_topology) && !cJSON_IsNull(deprecated_topology)) + { goto end;//primitive map container } - deprecated_topologyList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(deprecated_topology_local_map, deprecated_topology) + if(cJSON_IsObject(deprecated_topology)) { - cJSON *localMapObject = deprecated_topology_local_map; - if(!cJSON_IsString(localMapObject)) + deprecated_topologyList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(deprecated_topology_local_map, deprecated_topology) { - goto end; + cJSON *localMapObject = deprecated_topology_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(deprecated_topologyList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(deprecated_topologyList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_flex_persistent_volume_source.c b/kubernetes/model/v1_flex_persistent_volume_source.c index 63886516..1523c959 100644 --- a/kubernetes/model/v1_flex_persistent_volume_source.c +++ b/kubernetes/model/v1_flex_persistent_volume_source.c @@ -159,20 +159,24 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "options"); if (options) { cJSON *options_local_map = NULL; - if(!cJSON_IsObject(options)) { + if(!cJSON_IsObject(options) && !cJSON_IsNull(options)) + { goto end;//primitive map container } - optionsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(options_local_map, options) + if(cJSON_IsObject(options)) { - cJSON *localMapObject = options_local_map; - if(!cJSON_IsString(localMapObject)) + optionsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(options_local_map, options) { - goto end; + cJSON *localMapObject = options_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(optionsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(optionsList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_flex_volume_source.c b/kubernetes/model/v1_flex_volume_source.c index 9ee954a7..6940b855 100644 --- a/kubernetes/model/v1_flex_volume_source.c +++ b/kubernetes/model/v1_flex_volume_source.c @@ -159,20 +159,24 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "options"); if (options) { cJSON *options_local_map = NULL; - if(!cJSON_IsObject(options)) { + if(!cJSON_IsObject(options) && !cJSON_IsNull(options)) + { goto end;//primitive map container } - optionsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(options_local_map, options) + if(cJSON_IsObject(options)) { - cJSON *localMapObject = options_local_map; - if(!cJSON_IsString(localMapObject)) + optionsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(options_local_map, options) { - goto end; + cJSON *localMapObject = options_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(optionsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(optionsList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_json_schema_props.c b/kubernetes/model/v1_json_schema_props.c index f074c19d..57a8e50c 100644 --- a/kubernetes/model/v1_json_schema_props.c +++ b/kubernetes/model/v1_json_schema_props.c @@ -912,15 +912,19 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema cJSON *dependencies = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "dependencies"); if (dependencies) { cJSON *dependencies_local_map = NULL; - if(!cJSON_IsObject(dependencies)) { + if(!cJSON_IsObject(dependencies) && !cJSON_IsNull(dependencies)) + { goto end;//primitive map container } - dependenciesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(dependencies_local_map, dependencies) + if(cJSON_IsObject(dependencies)) { - cJSON *localMapObject = dependencies_local_map; - list_addElement(dependenciesList , localMapKeyPair); + dependenciesList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(dependencies_local_map, dependencies) + { + cJSON *localMapObject = dependencies_local_map; + list_addElement(dependenciesList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1_label_selector.c b/kubernetes/model/v1_label_selector.c index 298b0629..5739a34f 100644 --- a/kubernetes/model/v1_label_selector.c +++ b/kubernetes/model/v1_label_selector.c @@ -130,20 +130,24 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO cJSON *match_labels = cJSON_GetObjectItemCaseSensitive(v1_label_selectorJSON, "matchLabels"); if (match_labels) { cJSON *match_labels_local_map = NULL; - if(!cJSON_IsObject(match_labels)) { + if(!cJSON_IsObject(match_labels) && !cJSON_IsNull(match_labels)) + { goto end;//primitive map container } - match_labelsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(match_labels_local_map, match_labels) + if(cJSON_IsObject(match_labels)) { - cJSON *localMapObject = match_labels_local_map; - if(!cJSON_IsString(localMapObject)) + match_labelsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(match_labels_local_map, match_labels) { - goto end; + cJSON *localMapObject = match_labels_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(match_labelsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(match_labelsList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_limit_range_item.c b/kubernetes/model/v1_limit_range_item.c index c59be8e0..dcfcfe92 100644 --- a/kubernetes/model/v1_limit_range_item.c +++ b/kubernetes/model/v1_limit_range_item.c @@ -232,20 +232,24 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "default"); if (_default) { cJSON *_default_local_map = NULL; - if(!cJSON_IsObject(_default)) { + if(!cJSON_IsObject(_default) && !cJSON_IsNull(_default)) + { goto end;//primitive map container } - _defaultList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(_default_local_map, _default) + if(cJSON_IsObject(_default)) { - cJSON *localMapObject = _default_local_map; - if(!cJSON_IsString(localMapObject)) + _defaultList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(_default_local_map, _default) { - goto end; + cJSON *localMapObject = _default_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(_defaultList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(_defaultList , localMapKeyPair); } } @@ -253,20 +257,24 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i cJSON *default_request = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "defaultRequest"); if (default_request) { cJSON *default_request_local_map = NULL; - if(!cJSON_IsObject(default_request)) { + if(!cJSON_IsObject(default_request) && !cJSON_IsNull(default_request)) + { goto end;//primitive map container } - default_requestList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(default_request_local_map, default_request) + if(cJSON_IsObject(default_request)) { - cJSON *localMapObject = default_request_local_map; - if(!cJSON_IsString(localMapObject)) + default_requestList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(default_request_local_map, default_request) { - goto end; + cJSON *localMapObject = default_request_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(default_requestList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(default_requestList , localMapKeyPair); } } @@ -274,20 +282,24 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i cJSON *max = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "max"); if (max) { cJSON *max_local_map = NULL; - if(!cJSON_IsObject(max)) { + if(!cJSON_IsObject(max) && !cJSON_IsNull(max)) + { goto end;//primitive map container } - maxList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(max_local_map, max) + if(cJSON_IsObject(max)) { - cJSON *localMapObject = max_local_map; - if(!cJSON_IsString(localMapObject)) + maxList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(max_local_map, max) { - goto end; + cJSON *localMapObject = max_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(maxList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(maxList , localMapKeyPair); } } @@ -295,20 +307,24 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i cJSON *max_limit_request_ratio = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "maxLimitRequestRatio"); if (max_limit_request_ratio) { cJSON *max_limit_request_ratio_local_map = NULL; - if(!cJSON_IsObject(max_limit_request_ratio)) { + if(!cJSON_IsObject(max_limit_request_ratio) && !cJSON_IsNull(max_limit_request_ratio)) + { goto end;//primitive map container } - max_limit_request_ratioList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(max_limit_request_ratio_local_map, max_limit_request_ratio) + if(cJSON_IsObject(max_limit_request_ratio)) { - cJSON *localMapObject = max_limit_request_ratio_local_map; - if(!cJSON_IsString(localMapObject)) + max_limit_request_ratioList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(max_limit_request_ratio_local_map, max_limit_request_ratio) { - goto end; + cJSON *localMapObject = max_limit_request_ratio_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(max_limit_request_ratioList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(max_limit_request_ratioList , localMapKeyPair); } } @@ -316,20 +332,24 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i cJSON *min = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "min"); if (min) { cJSON *min_local_map = NULL; - if(!cJSON_IsObject(min)) { + if(!cJSON_IsObject(min) && !cJSON_IsNull(min)) + { goto end;//primitive map container } - minList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(min_local_map, min) + if(cJSON_IsObject(min)) { - cJSON *localMapObject = min_local_map; - if(!cJSON_IsString(localMapObject)) + minList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(min_local_map, min) { - goto end; + cJSON *localMapObject = min_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(minList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(minList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_node_status.c b/kubernetes/model/v1_node_status.c index b2168e93..d78be5b3 100644 --- a/kubernetes/model/v1_node_status.c +++ b/kubernetes/model/v1_node_status.c @@ -370,20 +370,24 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ cJSON *allocatable = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "allocatable"); if (allocatable) { cJSON *allocatable_local_map = NULL; - if(!cJSON_IsObject(allocatable)) { + if(!cJSON_IsObject(allocatable) && !cJSON_IsNull(allocatable)) + { goto end;//primitive map container } - allocatableList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(allocatable_local_map, allocatable) + if(cJSON_IsObject(allocatable)) { - cJSON *localMapObject = allocatable_local_map; - if(!cJSON_IsString(localMapObject)) + allocatableList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(allocatable_local_map, allocatable) { - goto end; + cJSON *localMapObject = allocatable_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(allocatableList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(allocatableList , localMapKeyPair); } } @@ -391,20 +395,24 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "capacity"); if (capacity) { cJSON *capacity_local_map = NULL; - if(!cJSON_IsObject(capacity)) { + if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) + { goto end;//primitive map container } - capacityList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(capacity_local_map, capacity) + if(cJSON_IsObject(capacity)) { - cJSON *localMapObject = capacity_local_map; - if(!cJSON_IsString(localMapObject)) + capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(capacity_local_map, capacity) { - goto end; + cJSON *localMapObject = capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(capacityList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(capacityList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_object_meta.c b/kubernetes/model/v1_object_meta.c index e642e90f..411c45fd 100644 --- a/kubernetes/model/v1_object_meta.c +++ b/kubernetes/model/v1_object_meta.c @@ -351,20 +351,24 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ cJSON *annotations = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "annotations"); if (annotations) { cJSON *annotations_local_map = NULL; - if(!cJSON_IsObject(annotations)) { + if(!cJSON_IsObject(annotations) && !cJSON_IsNull(annotations)) + { goto end;//primitive map container } - annotationsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(annotations_local_map, annotations) + if(cJSON_IsObject(annotations)) { - cJSON *localMapObject = annotations_local_map; - if(!cJSON_IsString(localMapObject)) + annotationsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(annotations_local_map, annotations) { - goto end; + cJSON *localMapObject = annotations_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(annotationsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(annotationsList , localMapKeyPair); } } @@ -445,20 +449,24 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ cJSON *labels = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "labels"); if (labels) { cJSON *labels_local_map = NULL; - if(!cJSON_IsObject(labels)) { + if(!cJSON_IsObject(labels) && !cJSON_IsNull(labels)) + { goto end;//primitive map container } - labelsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(labels_local_map, labels) + if(cJSON_IsObject(labels)) { - cJSON *localMapObject = labels_local_map; - if(!cJSON_IsString(localMapObject)) + labelsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(labels_local_map, labels) { - goto end; + cJSON *localMapObject = labels_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(labelsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(labelsList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_overhead.c b/kubernetes/model/v1_overhead.c index d6b27070..66e189f5 100644 --- a/kubernetes/model/v1_overhead.c +++ b/kubernetes/model/v1_overhead.c @@ -77,20 +77,24 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1_overheadJSON, "podFixed"); if (pod_fixed) { cJSON *pod_fixed_local_map = NULL; - if(!cJSON_IsObject(pod_fixed)) { + if(!cJSON_IsObject(pod_fixed) && !cJSON_IsNull(pod_fixed)) + { goto end;//primitive map container } - pod_fixedList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(pod_fixed_local_map, pod_fixed) + if(cJSON_IsObject(pod_fixed)) { - cJSON *localMapObject = pod_fixed_local_map; - if(!cJSON_IsString(localMapObject)) + pod_fixedList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(pod_fixed_local_map, pod_fixed) { - goto end; + cJSON *localMapObject = pod_fixed_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(pod_fixedList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(pod_fixedList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_persistent_volume_claim_status.c b/kubernetes/model/v1_persistent_volume_claim_status.c index 732c2ffa..e29cfd39 100644 --- a/kubernetes/model/v1_persistent_volume_claim_status.c +++ b/kubernetes/model/v1_persistent_volume_claim_status.c @@ -220,20 +220,24 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom cJSON *allocated_resources = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "allocatedResources"); if (allocated_resources) { cJSON *allocated_resources_local_map = NULL; - if(!cJSON_IsObject(allocated_resources)) { + if(!cJSON_IsObject(allocated_resources) && !cJSON_IsNull(allocated_resources)) + { goto end;//primitive map container } - allocated_resourcesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(allocated_resources_local_map, allocated_resources) + if(cJSON_IsObject(allocated_resources)) { - cJSON *localMapObject = allocated_resources_local_map; - if(!cJSON_IsString(localMapObject)) + allocated_resourcesList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(allocated_resources_local_map, allocated_resources) { - goto end; + cJSON *localMapObject = allocated_resources_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(allocated_resourcesList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(allocated_resourcesList , localMapKeyPair); } } @@ -241,20 +245,24 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "capacity"); if (capacity) { cJSON *capacity_local_map = NULL; - if(!cJSON_IsObject(capacity)) { + if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) + { goto end;//primitive map container } - capacityList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(capacity_local_map, capacity) + if(cJSON_IsObject(capacity)) { - cJSON *localMapObject = capacity_local_map; - if(!cJSON_IsString(localMapObject)) + capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(capacity_local_map, capacity) { - goto end; + cJSON *localMapObject = capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(capacityList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(capacityList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_persistent_volume_spec.c b/kubernetes/model/v1_persistent_volume_spec.c index 6bc9ef51..42a659a6 100644 --- a/kubernetes/model/v1_persistent_volume_spec.c +++ b/kubernetes/model/v1_persistent_volume_spec.c @@ -742,20 +742,24 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "capacity"); if (capacity) { cJSON *capacity_local_map = NULL; - if(!cJSON_IsObject(capacity)) { + if(!cJSON_IsObject(capacity) && !cJSON_IsNull(capacity)) + { goto end;//primitive map container } - capacityList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(capacity_local_map, capacity) + if(cJSON_IsObject(capacity)) { - cJSON *localMapObject = capacity_local_map; - if(!cJSON_IsString(localMapObject)) + capacityList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(capacity_local_map, capacity) { - goto end; + cJSON *localMapObject = capacity_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(capacityList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(capacityList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_pod_disruption_budget_status.c b/kubernetes/model/v1_pod_disruption_budget_status.c index 0877bcee..9ef32fd9 100644 --- a/kubernetes/model/v1_pod_disruption_budget_status.c +++ b/kubernetes/model/v1_pod_disruption_budget_status.c @@ -204,15 +204,19 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON cJSON *disrupted_pods = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "disruptedPods"); if (disrupted_pods) { cJSON *disrupted_pods_local_map = NULL; - if(!cJSON_IsObject(disrupted_pods)) { + if(!cJSON_IsObject(disrupted_pods) && !cJSON_IsNull(disrupted_pods)) + { goto end;//primitive map container } - disrupted_podsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(disrupted_pods_local_map, disrupted_pods) + if(cJSON_IsObject(disrupted_pods)) { - cJSON *localMapObject = disrupted_pods_local_map; - list_addElement(disrupted_podsList , localMapKeyPair); + disrupted_podsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(disrupted_pods_local_map, disrupted_pods) + { + cJSON *localMapObject = disrupted_pods_local_map; + list_addElement(disrupted_podsList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1_pod_spec.c b/kubernetes/model/v1_pod_spec.c index aebef924..e32586d2 100644 --- a/kubernetes/model/v1_pod_spec.c +++ b/kubernetes/model/v1_pod_spec.c @@ -944,20 +944,24 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "nodeSelector"); if (node_selector) { cJSON *node_selector_local_map = NULL; - if(!cJSON_IsObject(node_selector)) { + if(!cJSON_IsObject(node_selector) && !cJSON_IsNull(node_selector)) + { goto end;//primitive map container } - node_selectorList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(node_selector_local_map, node_selector) + if(cJSON_IsObject(node_selector)) { - cJSON *localMapObject = node_selector_local_map; - if(!cJSON_IsString(localMapObject)) + node_selectorList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(node_selector_local_map, node_selector) { - goto end; + cJSON *localMapObject = node_selector_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(node_selectorList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(node_selectorList , localMapKeyPair); } } @@ -971,20 +975,24 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ cJSON *overhead = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "overhead"); if (overhead) { cJSON *overhead_local_map = NULL; - if(!cJSON_IsObject(overhead)) { + if(!cJSON_IsObject(overhead) && !cJSON_IsNull(overhead)) + { goto end;//primitive map container } - overheadList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(overhead_local_map, overhead) + if(cJSON_IsObject(overhead)) { - cJSON *localMapObject = overhead_local_map; - if(!cJSON_IsString(localMapObject)) + overheadList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(overhead_local_map, overhead) { - goto end; + cJSON *localMapObject = overhead_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(overheadList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(overheadList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_replication_controller_spec.c b/kubernetes/model/v1_replication_controller_spec.c index 5613cbe2..5f0b68af 100644 --- a/kubernetes/model/v1_replication_controller_spec.c +++ b/kubernetes/model/v1_replication_controller_spec.c @@ -137,20 +137,24 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "selector"); if (selector) { cJSON *selector_local_map = NULL; - if(!cJSON_IsObject(selector)) { + if(!cJSON_IsObject(selector) && !cJSON_IsNull(selector)) + { goto end;//primitive map container } - selectorList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(selector_local_map, selector) + if(cJSON_IsObject(selector)) { - cJSON *localMapObject = selector_local_map; - if(!cJSON_IsString(localMapObject)) + selectorList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(selector_local_map, selector) { - goto end; + cJSON *localMapObject = selector_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(selectorList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(selectorList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_resource_quota_spec.c b/kubernetes/model/v1_resource_quota_spec.c index d74033d8..5424e053 100644 --- a/kubernetes/model/v1_resource_quota_spec.c +++ b/kubernetes/model/v1_resource_quota_spec.c @@ -128,20 +128,24 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "hard"); if (hard) { cJSON *hard_local_map = NULL; - if(!cJSON_IsObject(hard)) { + if(!cJSON_IsObject(hard) && !cJSON_IsNull(hard)) + { goto end;//primitive map container } - hardList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(hard_local_map, hard) + if(cJSON_IsObject(hard)) { - cJSON *localMapObject = hard_local_map; - if(!cJSON_IsString(localMapObject)) + hardList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(hard_local_map, hard) { - goto end; + cJSON *localMapObject = hard_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(hardList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(hardList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_resource_quota_status.c b/kubernetes/model/v1_resource_quota_status.c index e15e3e7a..66fe7e6e 100644 --- a/kubernetes/model/v1_resource_quota_status.c +++ b/kubernetes/model/v1_resource_quota_status.c @@ -112,20 +112,24 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "hard"); if (hard) { cJSON *hard_local_map = NULL; - if(!cJSON_IsObject(hard)) { + if(!cJSON_IsObject(hard) && !cJSON_IsNull(hard)) + { goto end;//primitive map container } - hardList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(hard_local_map, hard) + if(cJSON_IsObject(hard)) { - cJSON *localMapObject = hard_local_map; - if(!cJSON_IsString(localMapObject)) + hardList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(hard_local_map, hard) { - goto end; + cJSON *localMapObject = hard_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(hardList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(hardList , localMapKeyPair); } } @@ -133,20 +137,24 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res cJSON *used = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "used"); if (used) { cJSON *used_local_map = NULL; - if(!cJSON_IsObject(used)) { + if(!cJSON_IsObject(used) && !cJSON_IsNull(used)) + { goto end;//primitive map container } - usedList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(used_local_map, used) + if(cJSON_IsObject(used)) { - cJSON *localMapObject = used_local_map; - if(!cJSON_IsString(localMapObject)) + usedList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(used_local_map, used) { - goto end; + cJSON *localMapObject = used_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(usedList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(usedList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_resource_requirements.c b/kubernetes/model/v1_resource_requirements.c index 87119192..03686787 100644 --- a/kubernetes/model/v1_resource_requirements.c +++ b/kubernetes/model/v1_resource_requirements.c @@ -112,20 +112,24 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "limits"); if (limits) { cJSON *limits_local_map = NULL; - if(!cJSON_IsObject(limits)) { + if(!cJSON_IsObject(limits) && !cJSON_IsNull(limits)) + { goto end;//primitive map container } - limitsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(limits_local_map, limits) + if(cJSON_IsObject(limits)) { - cJSON *localMapObject = limits_local_map; - if(!cJSON_IsString(localMapObject)) + limitsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(limits_local_map, limits) { - goto end; + cJSON *localMapObject = limits_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(limitsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(limitsList , localMapKeyPair); } } @@ -133,20 +137,24 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "requests"); if (requests) { cJSON *requests_local_map = NULL; - if(!cJSON_IsObject(requests)) { + if(!cJSON_IsObject(requests) && !cJSON_IsNull(requests)) + { goto end;//primitive map container } - requestsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(requests_local_map, requests) + if(cJSON_IsObject(requests)) { - cJSON *localMapObject = requests_local_map; - if(!cJSON_IsString(localMapObject)) + requestsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(requests_local_map, requests) { - goto end; + cJSON *localMapObject = requests_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(requestsList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(requestsList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_scheduling.c b/kubernetes/model/v1_scheduling.c index 0223efc4..f9cdc7df 100644 --- a/kubernetes/model/v1_scheduling.c +++ b/kubernetes/model/v1_scheduling.c @@ -109,20 +109,24 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_schedulingJSON, "nodeSelector"); if (node_selector) { cJSON *node_selector_local_map = NULL; - if(!cJSON_IsObject(node_selector)) { + if(!cJSON_IsObject(node_selector) && !cJSON_IsNull(node_selector)) + { goto end;//primitive map container } - node_selectorList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(node_selector_local_map, node_selector) + if(cJSON_IsObject(node_selector)) { - cJSON *localMapObject = node_selector_local_map; - if(!cJSON_IsString(localMapObject)) + node_selectorList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(node_selector_local_map, node_selector) { - goto end; + cJSON *localMapObject = node_selector_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(node_selectorList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(node_selectorList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_secret.c b/kubernetes/model/v1_secret.c index 654eb8c5..9b06e118 100644 --- a/kubernetes/model/v1_secret.c +++ b/kubernetes/model/v1_secret.c @@ -195,20 +195,24 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "data"); if (data) { cJSON *data_local_map = NULL; - if(!cJSON_IsObject(data)) { + if(!cJSON_IsObject(data) && !cJSON_IsNull(data)) + { goto end;//primitive map container } - dataList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(data_local_map, data) + if(cJSON_IsObject(data)) { - cJSON *localMapObject = data_local_map; - if(!cJSON_IsString(localMapObject)) + dataList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(data_local_map, data) { - goto end; + cJSON *localMapObject = data_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(dataList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(dataList , localMapKeyPair); } } @@ -240,20 +244,24 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ cJSON *string_data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "stringData"); if (string_data) { cJSON *string_data_local_map = NULL; - if(!cJSON_IsObject(string_data)) { + if(!cJSON_IsObject(string_data) && !cJSON_IsNull(string_data)) + { goto end;//primitive map container } - string_dataList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(string_data_local_map, string_data) + if(cJSON_IsObject(string_data)) { - cJSON *localMapObject = string_data_local_map; - if(!cJSON_IsString(localMapObject)) + string_dataList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(string_data_local_map, string_data) { - goto end; + cJSON *localMapObject = string_data_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(string_dataList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(string_dataList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_service_spec.c b/kubernetes/model/v1_service_spec.c index 87ab5df1..e8e0199e 100644 --- a/kubernetes/model/v1_service_spec.c +++ b/kubernetes/model/v1_service_spec.c @@ -590,20 +590,24 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "selector"); if (selector) { cJSON *selector_local_map = NULL; - if(!cJSON_IsObject(selector)) { + if(!cJSON_IsObject(selector) && !cJSON_IsNull(selector)) + { goto end;//primitive map container } - selectorList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(selector_local_map, selector) + if(cJSON_IsObject(selector)) { - cJSON *localMapObject = selector_local_map; - if(!cJSON_IsString(localMapObject)) + selectorList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(selector_local_map, selector) { - goto end; + cJSON *localMapObject = selector_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(selectorList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(selectorList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_storage_class.c b/kubernetes/model/v1_storage_class.c index dbf12325..07395c7f 100644 --- a/kubernetes/model/v1_storage_class.c +++ b/kubernetes/model/v1_storage_class.c @@ -314,20 +314,24 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "parameters"); if (parameters) { cJSON *parameters_local_map = NULL; - if(!cJSON_IsObject(parameters)) { + if(!cJSON_IsObject(parameters) && !cJSON_IsNull(parameters)) + { goto end;//primitive map container } - parametersList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(parameters_local_map, parameters) + if(cJSON_IsObject(parameters)) { - cJSON *localMapObject = parameters_local_map; - if(!cJSON_IsString(localMapObject)) + parametersList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(parameters_local_map, parameters) { - goto end; + cJSON *localMapObject = parameters_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(parametersList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(parametersList , localMapKeyPair); } } diff --git a/kubernetes/model/v1_subject_access_review_spec.c b/kubernetes/model/v1_subject_access_review_spec.c index 85eaa607..975717c4 100644 --- a/kubernetes/model/v1_subject_access_review_spec.c +++ b/kubernetes/model/v1_subject_access_review_spec.c @@ -174,15 +174,19 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "extra"); if (extra) { cJSON *extra_local_map = NULL; - if(!cJSON_IsObject(extra)) { + if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) + { goto end;//primitive map container } - extraList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(extra_local_map, extra) + if(cJSON_IsObject(extra)) { - cJSON *localMapObject = extra_local_map; - list_addElement(extraList , localMapKeyPair); + extraList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(extra_local_map, extra) + { + cJSON *localMapObject = extra_local_map; + list_addElement(extraList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1_user_info.c b/kubernetes/model/v1_user_info.c index 15b68c7c..d7d47f1c 100644 --- a/kubernetes/model/v1_user_info.c +++ b/kubernetes/model/v1_user_info.c @@ -130,15 +130,19 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "extra"); if (extra) { cJSON *extra_local_map = NULL; - if(!cJSON_IsObject(extra)) { + if(!cJSON_IsObject(extra) && !cJSON_IsNull(extra)) + { goto end;//primitive map container } - extraList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(extra_local_map, extra) + if(cJSON_IsObject(extra)) { - cJSON *localMapObject = extra_local_map; - list_addElement(extraList , localMapKeyPair); + extraList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(extra_local_map, extra) + { + cJSON *localMapObject = extra_local_map; + list_addElement(extraList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1_volume_attachment_status.c b/kubernetes/model/v1_volume_attachment_status.c index 6bb415a1..eb8c1cba 100644 --- a/kubernetes/model/v1_volume_attachment_status.c +++ b/kubernetes/model/v1_volume_attachment_status.c @@ -150,20 +150,24 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * cJSON *attachment_metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "attachmentMetadata"); if (attachment_metadata) { cJSON *attachment_metadata_local_map = NULL; - if(!cJSON_IsObject(attachment_metadata)) { + if(!cJSON_IsObject(attachment_metadata) && !cJSON_IsNull(attachment_metadata)) + { goto end;//primitive map container } - attachment_metadataList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(attachment_metadata_local_map, attachment_metadata) + if(cJSON_IsObject(attachment_metadata)) { - cJSON *localMapObject = attachment_metadata_local_map; - if(!cJSON_IsString(localMapObject)) + attachment_metadataList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(attachment_metadata_local_map, attachment_metadata) { - goto end; + cJSON *localMapObject = attachment_metadata_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(attachment_metadataList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(attachment_metadataList , localMapKeyPair); } } diff --git a/kubernetes/model/v1beta1_endpoint.c b/kubernetes/model/v1beta1_endpoint.c index 737102d0..87779c64 100644 --- a/kubernetes/model/v1beta1_endpoint.c +++ b/kubernetes/model/v1beta1_endpoint.c @@ -259,20 +259,24 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ cJSON *topology = cJSON_GetObjectItemCaseSensitive(v1beta1_endpointJSON, "topology"); if (topology) { cJSON *topology_local_map = NULL; - if(!cJSON_IsObject(topology)) { + if(!cJSON_IsObject(topology) && !cJSON_IsNull(topology)) + { goto end;//primitive map container } - topologyList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(topology_local_map, topology) + if(cJSON_IsObject(topology)) { - cJSON *localMapObject = topology_local_map; - if(!cJSON_IsString(localMapObject)) + topologyList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(topology_local_map, topology) { - goto end; + cJSON *localMapObject = topology_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(topologyList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(topologyList , localMapKeyPair); } } diff --git a/kubernetes/model/v1beta1_overhead.c b/kubernetes/model/v1beta1_overhead.c index c013af5c..dd46448a 100644 --- a/kubernetes/model/v1beta1_overhead.c +++ b/kubernetes/model/v1beta1_overhead.c @@ -77,20 +77,24 @@ v1beta1_overhead_t *v1beta1_overhead_parseFromJSON(cJSON *v1beta1_overheadJSON){ cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1beta1_overheadJSON, "podFixed"); if (pod_fixed) { cJSON *pod_fixed_local_map = NULL; - if(!cJSON_IsObject(pod_fixed)) { + if(!cJSON_IsObject(pod_fixed) && !cJSON_IsNull(pod_fixed)) + { goto end;//primitive map container } - pod_fixedList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(pod_fixed_local_map, pod_fixed) + if(cJSON_IsObject(pod_fixed)) { - cJSON *localMapObject = pod_fixed_local_map; - if(!cJSON_IsString(localMapObject)) + pod_fixedList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(pod_fixed_local_map, pod_fixed) { - goto end; + cJSON *localMapObject = pod_fixed_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(pod_fixedList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(pod_fixedList , localMapKeyPair); } } diff --git a/kubernetes/model/v1beta1_pod_disruption_budget_status.c b/kubernetes/model/v1beta1_pod_disruption_budget_status.c index 238e648b..25f736d5 100644 --- a/kubernetes/model/v1beta1_pod_disruption_budget_status.c +++ b/kubernetes/model/v1beta1_pod_disruption_budget_status.c @@ -204,15 +204,19 @@ v1beta1_pod_disruption_budget_status_t *v1beta1_pod_disruption_budget_status_par cJSON *disrupted_pods = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_disruption_budget_statusJSON, "disruptedPods"); if (disrupted_pods) { cJSON *disrupted_pods_local_map = NULL; - if(!cJSON_IsObject(disrupted_pods)) { + if(!cJSON_IsObject(disrupted_pods) && !cJSON_IsNull(disrupted_pods)) + { goto end;//primitive map container } - disrupted_podsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(disrupted_pods_local_map, disrupted_pods) + if(cJSON_IsObject(disrupted_pods)) { - cJSON *localMapObject = disrupted_pods_local_map; - list_addElement(disrupted_podsList , localMapKeyPair); + disrupted_podsList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(disrupted_pods_local_map, disrupted_pods) + { + cJSON *localMapObject = disrupted_pods_local_map; + list_addElement(disrupted_podsList , localMapKeyPair); + } } } diff --git a/kubernetes/model/v1beta1_scheduling.c b/kubernetes/model/v1beta1_scheduling.c index 953da686..130d9832 100644 --- a/kubernetes/model/v1beta1_scheduling.c +++ b/kubernetes/model/v1beta1_scheduling.c @@ -109,20 +109,24 @@ v1beta1_scheduling_t *v1beta1_scheduling_parseFromJSON(cJSON *v1beta1_scheduling cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_schedulingJSON, "nodeSelector"); if (node_selector) { cJSON *node_selector_local_map = NULL; - if(!cJSON_IsObject(node_selector)) { + if(!cJSON_IsObject(node_selector) && !cJSON_IsNull(node_selector)) + { goto end;//primitive map container } - node_selectorList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(node_selector_local_map, node_selector) + if(cJSON_IsObject(node_selector)) { - cJSON *localMapObject = node_selector_local_map; - if(!cJSON_IsString(localMapObject)) + node_selectorList = list_createList(); + keyValuePair_t *localMapKeyPair; + cJSON_ArrayForEach(node_selector_local_map, node_selector) { - goto end; + cJSON *localMapObject = node_selector_local_map; + if(!cJSON_IsString(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); + list_addElement(node_selectorList , localMapKeyPair); } - localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); - list_addElement(node_selectorList , localMapKeyPair); } }