[Release-17] Upgrade SBI to v17.x.0

This commit is contained in:
Sukchan Lee 2023-03-01 19:56:49 +09:00
parent 969c116e77
commit 4d44b1843e
1687 changed files with 121604 additions and 9310 deletions

View file

@ -10,7 +10,10 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
OpenAPI_n1_message_class_e n1_message_class,
OpenAPI_n2_information_class_e n2_information_class,
OpenAPI_list_t *versions,
char *binding
char *binding,
char *accepted_encoding,
char *supported_features,
OpenAPI_list_t* service_info_list
)
{
OpenAPI_default_notification_subscription_t *default_notification_subscription_local_var = ogs_malloc(sizeof(OpenAPI_default_notification_subscription_t));
@ -22,6 +25,9 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
default_notification_subscription_local_var->n2_information_class = n2_information_class;
default_notification_subscription_local_var->versions = versions;
default_notification_subscription_local_var->binding = binding;
default_notification_subscription_local_var->accepted_encoding = accepted_encoding;
default_notification_subscription_local_var->supported_features = supported_features;
default_notification_subscription_local_var->service_info_list = service_info_list;
return default_notification_subscription_local_var;
}
@ -48,6 +54,24 @@ void OpenAPI_default_notification_subscription_free(OpenAPI_default_notification
ogs_free(default_notification_subscription->binding);
default_notification_subscription->binding = NULL;
}
if (default_notification_subscription->accepted_encoding) {
ogs_free(default_notification_subscription->accepted_encoding);
default_notification_subscription->accepted_encoding = NULL;
}
if (default_notification_subscription->supported_features) {
ogs_free(default_notification_subscription->supported_features);
default_notification_subscription->supported_features = NULL;
}
if (default_notification_subscription->service_info_list) {
OpenAPI_list_for_each(default_notification_subscription->service_info_list, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_def_sub_service_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(default_notification_subscription->service_info_list);
default_notification_subscription->service_info_list = NULL;
}
ogs_free(default_notification_subscription);
}
@ -115,6 +139,42 @@ cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_n
}
}
if (default_notification_subscription->accepted_encoding) {
if (cJSON_AddStringToObject(item, "acceptedEncoding", default_notification_subscription->accepted_encoding) == NULL) {
ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [accepted_encoding]");
goto end;
}
}
if (default_notification_subscription->supported_features) {
if (cJSON_AddStringToObject(item, "supportedFeatures", default_notification_subscription->supported_features) == NULL) {
ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [supported_features]");
goto end;
}
}
if (default_notification_subscription->service_info_list) {
cJSON *service_info_list = cJSON_AddObjectToObject(item, "serviceInfoList");
if (service_info_list == NULL) {
ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [service_info_list]");
goto end;
}
cJSON *localMapObject = service_info_list;
if (default_notification_subscription->service_info_list) {
OpenAPI_list_for_each(default_notification_subscription->service_info_list, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_def_sub_service_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
end:
return item;
}
@ -133,6 +193,10 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
cJSON *versions = NULL;
OpenAPI_list_t *versionsList = NULL;
cJSON *binding = NULL;
cJSON *accepted_encoding = NULL;
cJSON *supported_features = NULL;
cJSON *service_info_list = NULL;
OpenAPI_list_t *service_info_listList = NULL;
notification_type = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "notificationType");
if (!notification_type) {
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [notification_type]");
@ -201,13 +265,58 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
}
}
accepted_encoding = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "acceptedEncoding");
if (accepted_encoding) {
if (!cJSON_IsString(accepted_encoding) && !cJSON_IsNull(accepted_encoding)) {
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [accepted_encoding]");
goto end;
}
}
supported_features = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [supported_features]");
goto end;
}
}
service_info_list = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "serviceInfoList");
if (service_info_list) {
cJSON *service_info_list_local_map = NULL;
if (!cJSON_IsObject(service_info_list) && !cJSON_IsNull(service_info_list)) {
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [service_info_list]");
goto end;
}
if (cJSON_IsObject(service_info_list)) {
service_info_listList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(service_info_list_local_map, service_info_list) {
cJSON *localMapObject = service_info_list_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_def_sub_service_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(service_info_listList, localMapKeyPair);
}
}
}
default_notification_subscription_local_var = OpenAPI_default_notification_subscription_create (
notification_typeVariable,
ogs_strdup(callback_uri->valuestring),
n1_message_class ? n1_message_classVariable : 0,
n2_information_class ? n2_information_classVariable : 0,
versions ? versionsList : NULL,
binding && !cJSON_IsNull(binding) ? ogs_strdup(binding->valuestring) : NULL
binding && !cJSON_IsNull(binding) ? ogs_strdup(binding->valuestring) : NULL,
accepted_encoding && !cJSON_IsNull(accepted_encoding) ? ogs_strdup(accepted_encoding->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
service_info_list ? service_info_listList : NULL
);
return default_notification_subscription_local_var;
@ -219,6 +328,16 @@ end:
OpenAPI_list_free(versionsList);
versionsList = NULL;
}
if (service_info_listList) {
OpenAPI_list_for_each(service_info_listList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_def_sub_service_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(service_info_listList);
service_info_listList = NULL;
}
return NULL;
}